Doesn't work if file is not named after locale
Hello,
-
i18n-translate en.yml en.poworks -
i18n-translate user.yml user.podoesn't work
Any idea why?
Can you provide user.yml file?
Here it is:
---
en:
user:
cancel_account: cancel account
mailer:
confirmation_instructions:
confirm_account: Confirm account
message: Message
welcome: Welcome
sign_in: Sign in
sign_out: Logout
sign_up: Sign up
user: User
i18n-translators-tools is designed to work with directory structure and locales are determined from the file names, so it expects something like user/en.yml. Unfortunately I don't have much time to improve this tool to accept arbitrary conversions right now. If you provide reasonable patch that will keep compatibility I'm going to accept it.
Can you elaborate on why it needs the file name at all? I mean, the first key in all of these files is the locale...
Not all types are having locales information within. e.g java properties files does not have, so I needed to keep the information somewhere. If the locale information is in the file name you can convert properties to yaml successfully.
Ah, I see.
Is there a way to tell i18n-translate which locale we are talking about?
Something like i18n-translate -l en user.yml user.po would be nice.
I'm leaving this open, so I'll get back in to this in the future. For now you have to rename the file to en.yml and after conversion rename the po file back to user.po. Sorry for the inconvenience.
Alright, I'll see if I can find some time to make a PR. Thanks for the infos.