-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
This plugin usuable yet? #50
Comments
@kngai We've been using it in production for few months. It works, but has issues that I want to fix before making it ready for use as a public plugin. I started rewriting parts of it. I don't have any estimates when it will be finished. However, you can take a look at this: https://github.com/eldarc/test-vue-i18n-gettext This is a working example with the currently released plugins. Key files and directories to take a look: In this example you run the command Please let me know if this helped. |
Thanks @eldarc I was able to get my application working with that setup. Question:
<translate :translate-n="count" translate-plural="%{count} cars">%{count} car</translate> Some comments/notes on my end:
|
@kngai First of all thank you for trying out the plugin at this stage. For the plural for the currently released version it should be:
I added this to the example repository (https://github.com/eldarc/test-vue-i18n-gettext) However, in the new version that I'm working on it will be something like this:
same for the singular
The directive As for the extraction, it was intended to be adjustable, we even did automatic syncing with POEditor. So your configuration is great if it works for you and your translators. I'm also rewriting the A lot of work ahead, so please feel free to report anything and ask questions. The goal is to make really a full-featured plugin. At the beginning I used |
@kngai Just to add something. You said:
I would recommend that you send The The compilation process then takes all |
@eldarc Thanks again. Got the plural working. In terms of using the new Follow up question: What about annotating strings in JS? I'm using https://github.com/Polyconseil/vue-gettext#1b-annotating-strings-in-javascript-code-js-or-vue-files as reference. Perhaps you can update the README file to show the examples you have currently, so I don't have to keep bugging you :) Perhaps I just like simple/self-descriptive names, but I like the
I find those will keep consistent with the
I think having As for your note on sending the Which reminds me, when I first tried creating the Overall, I'm happy for this plugin moving forward. This bundled gettext extractor and compiler tool in one package is what sold me. I'm really thinking of using this in our production environment for our translation process. |
You can use gettext with the vm like this: If you want comments inside
For interpolation (this needs some testing to see how it behaves): or if you have Please keep in mind that if you want to use those strings without needing to refresh the whole app once the language is switched you need to define them in For using formatting: Those methods use Intl.NumberFormat (https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/NumberFormat) and options accept settings for that constructor. If you are passing the router to the plugin you can access the automatically modified routes like this: Thanks @kngai for the name suggestions. I will try to see if I can reproduce some of the encoding issues, at the moment I can't remember that I came across something similar. Let me know if you have some more details. Yeah you right that I should write some documentation, but will try to do so once I publish the first new version with a working full example demo. A lot of work to do before I can be sure that is safe for all users. |
Hi @eldarc,
I'm quite interested in such a gettext extractor and compilor for vue-i18n. Is this ready to be used?
I was looking at https://github.com/eldarc/vue-i18n-gettext/tree/master/examples/full-demo and trying to mimic that setup on my Vue project, but I wasn't able to get it working (getting 0 messages extracted).
The text was updated successfully, but these errors were encountered: