nextcloud / welcome

Welcome widget in Nextcloud's dashboard
GNU Affero General Public License v3.0
17 stars 11 forks source link

Language aware content / file(s) #32

Open joho1968 opened 1 year ago

joho1968 commented 1 year ago

It'd be nice if the plugin could support a multi lingual situation.

Perhaps filename.md being the default, and then look for filename_lang_locale.md (based on the user's locale) and use if found.

So, for a user with the Swedish language and Swedish locale settings filename_sv_SE.md would be used. If no such file exist, filename.md is used.

Since you can set language and locale independently of each other in NC, you'd need both.

Just a thought.

julien-nc commented 1 year ago

Thanks for the suggestion. This could indeed be very nice.

So the localized files would need to be in the same directory than the main file.

I would consider merging this if someone would like to implement it!

joho1968 commented 1 year ago

So the localized files would need to be in the same directory than the main file.

Yeah, I think that'd keep configuration to a minimum.

I would consider merging this if someone would like to implement it!

I don't have any experience with Nextcloud apps (yet), but I'll be happy to take a look at it.

joho1968 commented 1 year ago

Trying to navigate around the Nextcloud API, etc (which, IMHO, has some serious documentation blackouts :roll_eyes:), I find differences between your app and their sample Dashboard Widget in their new tutorials.

You have class WelcomeWidget implements IWidget, they have class SimpleWidget implements IAPIWidget. But maybe that's just me not understanding things :sunglasses:

What I'm somewhat confused about is how to get the current user's language and locale in your FileService.php and where it should be passed from/called on.

joho1968 commented 1 year ago

I would consider merging this if someone would like to implement it!

Done :blush: