Plugin multilingue 🌐

Le plugin Multilingue permet aux administrateurs d’un forum multilingue de crĂ©er un environnement riche et comprĂ©hensible pour tous les utilisateurs et invitĂ©s, mĂȘme s’ils ne parlent pas la langue par dĂ©faut ou majoritaire du forum.

:page_facing_up: Obtenir le code

:book: Lire la documentation


Aperçu des fonctionnalités

Le plugin Multilingue étend le systÚme de locale existant de Discourse pour vous offrir :

  1. une interface d’administration pour toutes les langues utilisĂ©es sur votre forum ;

  2. un systùme de langue de contenu qui vous permet, ainsi qu’à vos utilisateurs, de filtrer le contenu de votre forum par langue ;

  3. une intégration avec le plugin Traducteur de Discourse, qui automatise certains aspects du systÚme de langue de contenu ;

  4. la possibilitĂ© de traduire les noms de catĂ©gories, les tags et d’autres textes semi-statiques sur votre forum ;

  5. la possibilitĂ© de dĂ©sactiver l’utilisation des langues d’interface existantes sur votre forum ;

  6. la possibilitĂ© d’ajouter des langues d’interface personnalisĂ©es (« locales ») directement Ă  votre forum ;

  7. des fonctionnalitĂ©s de langue pour les invitĂ©s amĂ©liorĂ©es, notamment un sĂ©lecteur de langue d’interface pour les invitĂ©s (« locale ») (sous forme de barre de pied de page ou de menu) ; et

  8. des champs facultatifs de langue d’interface et de langue de contenu lors de l’inscription (bientît disponible).


:point_right: Veuillez noter

Toutes les fonctionnalitĂ©s ci-dessus fonctionnent au-dessus du systĂšme de locale existant de Discourse et en conjonction avec toutes les fonctionnalitĂ©s de ce systĂšme (voir l’explication dĂ©taillĂ©e ici).

Si vous souhaitez ajouter des langues d’interface (« locales ») Ă  Discourse, la meilleure mĂ©thode consiste Ă  suivre les Ă©tapes dĂ©crites ici : How to add a new language. Vous pouvez Ă©galement ajouter une locale via un plugin, comme dĂ©crit ici.

La possibilitĂ© de le faire via l’interface d’administration de ce plugin ne devrait ĂȘtre envisagĂ©e qu’aprĂšs avoir Ă©puisĂ© les mĂ©thodes prises en charge par Discourse. Toutes les langues ajoutĂ©es Ă  Discourse via les mĂ©thodes prises en charge par Discourse seront automatiquement disponibles pour toutes les fonctionnalitĂ©s de ce plugin.


Captures d’écran d’exemple

Interface d’administration

Traductions de textes semi-statiques (et sélecteur de locale pour les invités)

SystĂšme de langue de contenu

Screen Shot 2020-02-25 at 2.24.51 PM

Intégration du plugin Traducteur avec le systÚme de langue de contenu


Crédits

Ce plugin a Ă©tĂ© rendu possible grĂące au soutien de la Fondation Wikimedia, avec un soutien particulier de @Elena_Lappen et @icaria36, qui ont apportĂ© une contribution significative Ă  la conception de l’ensemble des fonctionnalitĂ©s.

Pour en savoir plus sur la réflexion derriÚre ce plugin, consultez :

Structuring a multilingual community

68 « J'aime »

Wow! You have been busy. :slight_smile: Nice work, @angus! Look forward to seeing examples of this in the wild. Let me know if you need somebody like me to look at it and give feedback.

One gap has been the lack of a feature to enable staff to improve translations of posts provided by the translate plugin - is that going to be part of this effort?

10 « J'aime »

hm. I’m not rulling it out, but that is probably more in the scope of the Translate Plugin.

A somehwat related feature which I built at one point for something else is a little count icon that shows for users when the locale they’re using falls back to the default locale because a translation is missing. Click the icon and you see:

“x translations missing for this page. Help us translate them here: (link to discourse’s transifex).”

7 « J'aime »

Fantastic work as usual Angus! I’ve been testing it on my site and have a couple of small issues and some questions.

Issues

  1. When you edit an existing topic the dropdown menu text does not follow the theme colors:

image

  1. The content language setting becomes very hard to use beyond a couple of languages due to the single line

Questions

  1. It seems as though many of our old topics are getting the language tag retroactively, which is desired, but only a handful at this point. Will a job run to apply the tag to all existing posts eventually? If not, is there a way to apply a language tag to all existing posts? Our site has been only English up to this point so I want all existing posts to have the en tag.
  2. When you have multiple languages set under content languages should you be able to filter by an individual language? Currently when I click one of the languages in the drop down nothing happens.
2 « J'aime »

Thanks for the feedback David and giving this a shot. I’ve pushed a number of udpates that, among other things, fix the two problems you mention above.

Not yet. Currently only the posts translated by the Translator plugin will automatically get a content tag retroactively (if the translator plugin is enabled and the sync feature is enabled).

I can add such a job, but it’ll need to take a specific language as a parmeter and run on a defined scope. In addition to a ‘site wide’ scope, I could do it on a per-category, or per (non-content) tag basis (i.e. apply this content tag to all topics in this category or with this other tag). What would work for you?

No, the list is mean to just show you what your content languages are currently set at. Could you walk me through how you expect (or would like) this to behave?

2 « J'aime »

Thank you Angus, that fixed up my problems.

Ideally I would like to have the en tag applied to all existing posts that do not have a language tag, is that too broad? The problem is that if a user sets their content language to say English and Spanish, they will then only see the posts with the language tag, they will not see the thousands of posts that have no tag.

Because there is a list and they highlight when hovered, it gives the impression that they are clickable. My expectation in that case is that when you click on one of them your posts would be filtered by that language. I think this could be a useful feature to filter by language, but it’s not something I’m dying to have either.

On another note; I would love to have the option to move the language button. I have a lot of items in my nav bar already and it’s starting to get cluttered. Also the highlighted button looks out of place above the new topic button and it’s forcing the new topic button below. I suppose it’s not possible to move it to the beginning of the navbar, say before Latest? Or it could be floating in a corner like I have on my wordpress homepage https://naturephotographers.network , or it could go in the header similar to the option in the translate plugin.

I understand your reasoning for putting it in the navbar, because you are filtering similar to the other buttons, but the thing is that you would only set this once and then forget it. It’s not like you would be regularly filtering by different languages.

Thanks again, this plugin along with translate is a game changer.

3 « J'aime »

To me, this is the desired behavior. Users must not see posts in a foreign language. If there is no post is their language, they must see no post.

However, as an option, a “bulk tagging” feature would be nice.

2 « J'aime »

Agreed, the solution I proposed on Pavilion is if the default locale matches one of the selected topic languages, then show all posts without tags. But bulk tagging would be the better option.

@angus, I am not 100% sure if this is related to your plugin or a change in core, but there may be a bug I’ve come across. When I edit an existing post, make some changes and try to save I get this error None of the tags you selected can be used, there are no tags set except the en tag, and minimun number of tags required in a topic is set to 0. Any ideas?

2 « J'aime »

Ran into another issue today Angus, I previously had an ig tag (short for instagram) that was deleted by the plugin to make way for the Igbo language. I assume there’s no way to get this back? I tried turning off the plugin in hopes that it may still be there, but alas it appears to be long gone. I know this a risk you take when testing plugins. You might want to add a warning that it will delete any tags with the same name.

3 « J'aime »

I’ll pm you about that (It’s unlikely to be lost)

The other useful suggestions and feedback, I’ll be reviewing tomorrow.

3 « J'aime »

My Godness! You are fantastic!
I mean, I really admire you. While I also hope this post will not distract people’s attention on your fabulous work.

7 « J'aime »

Just a note that David and I have resolved this issue and restored the existing ig tags.

If there is a conflict between a pre-existing tag and a content language tag, the language won’t be available as a content language until the conflict is resolved. You’ll see this in your languages admin.

I’ll be addressing any other issues and feature requests in the coming week.

9 « J'aime »

Cher Angus, est-il possible d’utiliser uniquement le sĂ©lecteur de langue pour les invitĂ©s ? Je n’ai pas besoin d’utiliser toutes les fonctions de ce systĂšme — je souhaite simplement permettre aux invitĂ©s de changer la langue de l’interface.

2 « J'aime »

Chaque fonctionnalité du plugin fonctionne indépendamment.

Installez le plugin et activez simplement le sélecteur de langue : Pavilion.

Nous utilisons actuellement ce plugin Ă  cette fin sur thepavilion.io.

4 « J'aime »

Excellent travail @angus !

Nous avons installĂ© le plugin, mais dĂ©sormais aucun contenu n’est visible pour les utilisateurs, mĂȘme pour le personnel. Cependant, lorsque vous Ă©ditez une catĂ©gorie et tentez de la supprimer, nous obtenons alors l’avertissement suivant :

La seule façon d’accĂ©der Ă  un sujet est alors de suivre le lien dans le message d’avertissement ou de connaĂźtre l’URL du sujet. Si nous accĂ©dons au sujet (RIO Paris) et ajoutons ensuite une balise de langue de contenu, par exemple « english », il devient visible comme prĂ©vu. Nous pensons que le plugin Multilingue fonctionne parfaitement. Seul le contenu associĂ© Ă  une balise est affichĂ©. Cependant, nous trouvons cela trompeur et dĂ©routant lorsque les gens ne peuvent pas voir tous les sujets liĂ©s sans associer une balise de langue. Nous avons des milliers de sujets prĂ©cĂ©demment publiĂ©s qui sont invisibles. Existe-t-il une solution pour attribuer rapidement une balise de langue Ă  ceux-ci, car nous ne pouvons pas voir de liste pour le moment ?

Veuillez nous conseiller.

ÉditĂ© : J’ai rĂ©solu mon problĂšme de visibilitĂ© en ajoutant des balises Ă  tous les sujets de certaines catĂ©gories selon la langue qu’elles Ă©taient censĂ©es utiliser, dans Rails :

  1. cd /var/discourse puis ./launcher enter app
  2. obtenir les identifiants des catégories avec rake categories:list
  3. Si une catĂ©gorie ne devant contenir que des sujets en allemand a l’identifiant 245, alors rake tags:bulk_tag_category["de",245]
1 « J'aime »

J’obtiens une page blanche aprĂšs avoir exĂ©cutĂ© :
./launcher rebuild app

J’ai dĂ©couvert que c’est ce plugin qui en est la cause. Impossible d’accĂ©der au site et Ă  la partie administration.
J’ai seulement activĂ© le contenu multilingue, mais je ne l’ai pas configurĂ©.

Comment puis-je réinitialiser les paramÚtres de ce plugin dans la base de données ?

Est-ce que votre.website.com/safe-mode fonctionne ?

J’ai dĂ©sactivĂ© ce plugin maintenant. Les problĂšmes ont commencĂ© avec la disparition de la liste des plugins dans le panneau d’administration. Ensuite, j’ai essayĂ© de reconstruire l’application. Mais aprĂšs la reconstruction, le site ne s’ouvrait plus. Maintenant, il s’ouvre, mais avec ce plugin dĂ©sactivĂ©.

@angus, peux-tu vérifier ton plugin avec une version récente de Discourse ?

En mode sans échec sans les plugins non officiels, je vois cette page sans la liste des plugins :

Mode sans échec sans tous les plugins :

Est-il possible de réinitialiser les paramÚtres de ce plugin dans la base de données ?

À cette Ă©poque, aucun mode ne pouvait rĂ©soudre le problĂšme (sĂ»r, sans version non officielle, sans tout) — dans tous les modes, je ne voyais pas la liste des plugins installĂ©s dans le systĂšme.

1 « J'aime »