Repository navigation
Fix Auto language for Traditional Chinese and Brazilian Portuguese - #83
Merged
Merged
Conversation
arnowelzel
approved these changes
Nov 4, 2026
arnowelzel
requested changes
Nov 4, 2026
arnowelzel
left a comment
Owner
There was a problem hiding this comment.
Please fix the failing unit test at tests/unit/Controller/EditorControllerTest.php, line 616:
$this->assertSame('pt', $params['drawioLang']);
Due to your changes this should be:
$this->assertSame('pt-br', $params['drawioLang']);
Contributor
Author
|
Thanks! I've updated the unit test to expect |
arnowelzel
self-requested a review
November 5, 2026 14:15
Owner
Thanks for the update. I will prepare an official update as soon as possible. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
When the language is set to "Auto", the Nextcloud locale is truncated at the underscore
(e.g.
zh_TW->zh,pt_BR->pt). In draw.io,zhis Simplified Chinese andptis European Portuguese, so Traditional Chinese and Brazilian users get the wrong UI language.
This maps
zh_TW,zh_HK,zh_MO,zh_Hanttozh-twandpt_BRtopt-br(both are listed in the language selector), and keeps the existing behavior for other locales.
Steps to reproduce: set Diagramming language to Auto, set the Nextcloud user language to
"Chinese (Traditional)", open a .drawio file -> the editor shows Simplified Chinese.
Related issues
None (no existing issue found).
Testing
npm run buildsuccessfullyPHP-only change in
EditorController.php(no JS changes, so no rebuild needed).The same mapping is running on our production Nextcloud.