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

Merge arrays-*.po (and arrays.pot) and strings-*.po (and strings.pot) #29

Open
murraycu opened this issue Nov 18, 2014 · 4 comments
Open

Comments

@murraycu
Copy link

Translators expect to deal with only one .po file, so it's awkward that we a2po generates a separate set of po/pot files for each XML file that has translatable strings. It would be great if they could be merged into one file, though I guess there would need to be some marker to identify the source so they could be imported back into the correct XML again.

@miracle2k
Copy link
Owner

Is it possible this is already supported? What happens if you don't have a %(group)s in your layout?

See https://github.com/miracle2k/android2po/blob/master/example.config#L33

@murraycu
Copy link
Author

Sorry, I've read that but I don't understand what I should try.

My .android2po file did look like this:
--android app/src/main/res --gettext app/src/main/locale
So I don't seem to be using a group.

I tried making my .android2po file look like this, as suggested in that documentation, just to see what happens:
--android app/src/main/res --gettext app/src/main/locale --layout %(locale)/%(domain)/%(group).po

But then I get this error:
Error: --layout lacks %(locale)s variable

Thanks and sorry if I'm not seeing something obvious.

@miracle2k
Copy link
Owner

Try this:

 --layout %(locale)s.po

Note the s at the end of the variable. My hope is that the lack of %(group)s will mean the different xml resource are merged, but maybe it is not implemented.

@murraycu
Copy link
Author

Thanks, but I then get this error:

Error: --layout needs %(group)s variable, since you have multiple groups: arrays, strings

For now, I am just putting everything in strings.xml to avoid the problem. I didn't realize before that I could put s in strings.xml.

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

2 participants