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

Allow creating fallback languages #120

Open
robsch opened this issue May 24, 2018 · 3 comments
Open

Allow creating fallback languages #120

robsch opened this issue May 24, 2018 · 3 comments
Milestone

Comments

@robsch
Copy link

robsch commented May 24, 2018

In Yii2 it is possible to define and use default languages (also have a look here). That is one can have the language en-US, but also the general en. en will be used as fallback when the language gets set to en-GB for example.

So the translage manager should allow to define such languages as well. If I'm not wrong, that would just require that the Language rules gets changed a little bit. language_id should work with two characters and country should be empty. Isn't that all?

Would you consider doing this?

@moltam
Copy link
Collaborator

moltam commented May 28, 2018

This extension provides an interface for translation. The Yii 2 handles the message displaying, the way you configure it. So I think that Yii 2 still handles the fallback language selection.

If you need the en language, then you can add it to the language list with the extension (translatemanager/language/create) or modify an existing entry (e.g. en-US -> en), and you can create messages for this language too. The mentioned language ruleset allows to define languages with two letter ids (^/([a-z]{2}[_-][A-Z]{2}|[a-z]{2})$/)

@robsch
Copy link
Author

robsch commented May 29, 2018

You're right, language_id is already fine for two-letter ids. However, country should then be empty. Since the id does not contain a region anymore. Or one has to enter 'xy' or something like that. It is just a tiny change.

I'm wondering if language and country property is needed at all. They are already part of the language_id.

@moltam
Copy link
Collaborator

moltam commented May 30, 2018

I think the language and country property is not needed, they are just part of the database schema but not used. They can be made optional.

@moltam moltam added this to the 1.7.x milestone Jun 4, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants