-
Notifications
You must be signed in to change notification settings - Fork 26
Convert language from using ID nums to ISO names #315
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
Conversation
|
|
||
| if (!$lang_id) | ||
| { | ||
| throw new \phpbb\boardrules\exception\unexpected_value(array('rule_language', 'WRONG_DATA_LANG', 'UNEXPECTED_VALUE')); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah I know. I just don't care about that for now. The exceptions classes don't translate that.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK, this has been solved too now.
migrations/v20x/m15_language_iso.php
Outdated
|
|
||
| namespace phpbb\boardrules\migrations\v20x; | ||
|
|
||
| class m15_language_iso extends \phpbb\db\migration\container_aware_migration |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Container seems not to be used in this migration 😛
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Belive me, there are new migration files inbound eventually once I figure a way around postgresql b.s. ;)

phpBB seems to use the language's ISO name more than the language's ID. If we switch to using ISO code names we can more easily handle language stuff, such as referencing a board's default lang from the config array. This will also prevent problems if a user deletes, then reinstalls a language pack, which could result in orphaning the rules written in that language (because the ID will change, but the ISO code will remain the same).