learnweb / moodle-mod_collabora

:memo: :globe_with_meridians: An activity for live document editing in Moodle, powered by Collabora Online
GNU General Public License v3.0
8 stars 8 forks source link

mod_collabora: add simple multi lang support #24

Closed grabs closed 3 years ago

grabs commented 3 years ago

Hi, I added a simple multi lang support for this plugin. Since the loleaflet.html accepts a lang parameter. 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 en or en-us (note the hyphen). Strings with a wrong second part are also possible which leads to a fallback of the first part. The string de_comm which does not exist in collabora would result in de. A not accepted first part, e.g. yy_abc will 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

codecov-commenter commented 3 years ago

Codecov Report

Merging #24 into master will decrease coverage by 0.48%. The diff coverage is n/a.

Impacted file tree graph

@@             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     
Impacted Files Coverage Δ Complexity Δ
moodle/mod/collabora/classes/collabora.php 33.17% <0.00%> (-4.33%) 64.00% <0.00%> (+5.00%) :arrow_down:

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update fc22536...7032a63. Read the comment docs.

mwuttke commented 3 years ago

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

mwuttke commented 3 years ago

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 commented 3 years ago

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 moodle group and/or gouping mode too?

Hi @moodlebeuth ,

I suspect the above comment was meant for one of my PRs, Michael? If so, which one? And what is grouping mode?

Thanks!

mwuttke commented 3 years ago

Hi @Ashod: I am sos orry, my fault. I meant #21.