dotnetic Posted December 20, 2019 Share Posted December 20, 2019 Not "exactly", as I added a slug/url field your proposed solution ? So we are thinking the same, and we should add a request for this, but it is a breaking change to the core. Not sure if Ryan is willing to do this. Or he/we finds a way to be backwards compatible, where the language name is different than the ISO code. The PR that @LostKobrakai provided is a bit different to this behaviour, as it would require users to import the translations by hand. The new solution could load the translations automatically, as the language code is predefined. 1 Link to comment Share on other sites More sharing options...
Gadgetto Posted December 20, 2019 Author Share Posted December 20, 2019 @Jens Martsch - dotnetic I don't think that's gonna happen anytime soon. Link to comment Share on other sites More sharing options...
LostKobrakai Posted December 20, 2019 Share Posted December 20, 2019 First of all ISO 3166 is for countries, not languages – there are countries like switzerland, which has 4 official languages. ISO 639 is what we would need. But ProcessWire doesn't care about that. You could be needing Globish, which doesn't have an iso code. So the iso code should always be optional anyways. This difficulty is exactly why I made my PR not rely on an automatic mapping, but simply let users decide which translation to import into which language of the system. Once processwire might add an field for iso codes to the languages template it's an easy addition to detect matching codes and suggest imports to the user automatically. 1 Link to comment Share on other sites More sharing options...
Gadgetto Posted December 20, 2019 Author Share Posted December 20, 2019 11 minutes ago, LostKobrakai said: First of all ISO 3166 is for countries, not languages – there are countries like switzerland, which has 4 official languages. ISO 639 is what we would need. You're right, of course! 1 Link to comment Share on other sites More sharing options...
dotnetic Posted December 20, 2019 Share Posted December 20, 2019 9 minutes ago, LostKobrakai said: You could be needing Globish, which doesn't have an iso code. So the iso code should always be optional anyways. The workflow could be like this: Add new language -> List of predefined languages with ISO code is provided, and a "Language not in this list? Add a custom language" option. So modules could use automatic translations for all predefined languages and for the custom language you could import the language file by hand. Link to comment Share on other sites More sharing options...
LostKobrakai Posted December 20, 2019 Share Posted December 20, 2019 38 minutes ago, Jens Martsch - dotnetic said: The workflow could be like this: Add new language -> List of predefined languages with ISO code is provided, and a "Language not in this list? Add a custom language" option. The downside would be the need to ship a list of languages/iso codes with the processwire core. I guess with weekly releases it's not to much of a pain though to require a fresh release once there's a change in that list. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now