Skip to content
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

Compiling from multiple files #129

Open
milica opened this issue Jan 28, 2016 · 3 comments
Open

Compiling from multiple files #129

milica opened this issue Jan 28, 2016 · 3 comments

Comments

@milica
Copy link

milica commented Jan 28, 2016

I have a use-case for this, for example I have default translations which are generated using .extract, but also I have custom translations which can't be extracted from the code and those are added manually (in separate *.po file).
For example, there is list of items which has description where several values need to be interpolated like name or some other value. But, there are some special items which have totally different description and don't fit the pattern, so in order to avoid IFs I just define that special description for that particular item in that separate manually created *.po file (with the key 123.description for example). Currently, if I point .compile to those files only the last one will be generated. So, I have *.po files like this:

  • /default/en.po
  • /default/zh.po
  • /custom/en.po
  • /custom/zh.po

After compiling I'll get translations only for the last one that has been taken by the .compile, and I would like to have translations merged, meaning to have translations from /default/en.po and /custom/en.po into one single en.js (or en.json)

Does it make sense to have this support within this plugin, or there should be separate plugin which would deal with this?

At this moment I'm using gulp version and I'm altering output of the .compile in a way that I'm caching outputs and merge them in dedicated function, but it's a bit dirty and I don't like it...

@SebastianRolf
Copy link

I built a gulp module you could use:
https://github.com/SebastianRolf/gulp-concat-po-modules

It merges .po files from several directories into one file per language, so you would get
/i18n/en.po
/i18n/zh.po

form your example.

@milica
Copy link
Author

milica commented Aug 21, 2016

That's really cool! I'll try it out once I have time, thanks :)

@mattbrunetti
Copy link

It would be great if this was supported in the core, and another package wasn't necessary to do this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants