mod_collabora: add simple multi lang support#24
Conversation
Codecov Report
@@ Coverage Diff @@
## master #24 +/- ##
============================================
- Coverage 14.02% 13.53% -0.49%
- Complexity 137 142 +5
============================================
Files 17 17
Lines 699 724 +25
============================================
Hits 98 98
- Misses 601 626 +25
Continue to review full report at Codecov.
|
|
Hello Ashod, you have made a lot of code changes. Thanks a lot of your work! Do you have tested all these settings with moodle group and/or grouping mode too? @grabs please could you review this patch? Michael |
|
Hello Andreas, I've tested your PR and it works as expected. Thanks for your work! @Ashod: please could you review this patch? Michael |
Ashod
left a comment
There was a problem hiding this comment.
Looks good, one minor improvement suggested.
classes/collabora.php
Outdated
| } | ||
|
|
||
| // If we got here we check the system language as first fallback. | ||
| $systemlang = isset($CFG->lang) ?: 'en'; |
There was a problem hiding this comment.
'en' -> self::FALLBACK_LANG
Seems cleaner to avoid hard-coded value when we have a named const.
Hi @moodlebeuth , I suspect the above comment was meant for one of my PRs, Michael? Thanks! |
Hi,
I added a simple multi lang support for this plugin.
Since the
loleaflet.htmlaccepts alangparameter. So we can use the current language to set the interface language of the collabora instance.Collabora does not accept all lang strings. So I use a constant with accepted strings. Maybe later we can change this into a setting.
Collabora need strings like
enoren-us(note the hyphen). Strings with a wrong second part are also possible which leads to a fallback of the first part. The stringde_commwhich does not exist in collabora would result inde.A not accepted first part, e.g.
yy_abcwill result in an empty page. To prevent this I check the first part of the current language and compare it with the accepted strings list.Best regards
Andreas