Skip to content

Conversation

@iMattPro
Copy link
Contributor

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).


if (!$lang_id)
{
throw new \phpbb\boardrules\exception\unexpected_value(array('rule_language', 'WRONG_DATA_LANG', 'UNEXPECTED_VALUE'));
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

WRONG_DATA_LANG appears unhandled if you set wrong language iso, like
rule_warn

Copy link
Contributor Author

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.

Copy link
Contributor Author

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.


namespace phpbb\boardrules\migrations\v20x;

class m15_language_iso extends \phpbb\db\migration\container_aware_migration
Copy link
Contributor

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 😛

Copy link
Contributor Author

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. ;)

@iMattPro iMattPro merged commit c997183 into phpbb-extensions:master Apr 17, 2017
@iMattPro iMattPro deleted the lang-iso branch April 17, 2017 06:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants