What exactly are the effects of "allow user locale"

That would require that admins can limit which locale their users can choose. That would also be a solution, but it would prevent communities from benefiting from the increasing number of translations that discourse provides out of the box.

You are fixating on problems specific to you, that is, you believe that customizing text in one language should somehow magically customize the same text in every available human language. I do not share this belief and I feel, very strongly, that you should bear the burden of your own choices with regards to text customization. If you want to customize text in every language, you take responsibility for that work, not us.

Furthermore, I also fail to share your belief that non-customized text is some kind of disaster of epic proportions. Default text is harmless.

My reply was actually based on my understanding of the code when I last changed it. I guess it was a while back :wink: I very much prefer that we are now consistent across all UI text even though it means more work on admins when they customize some text. I also :+1:t2: your suggestion.

「いいね!」 4

No, this is a misunderstanding. I am merely looking for a way to allow users to use existing locales while still allowing site admins to customize texts, especially the discobot welcome message. Currently, you have the choice of either allowing user locales or customizing.

I have said nothing to convey such a belief. However, default text can be a problem under certain circumstances, for example when you have customized the welcome message to provide certain site specific information to new users but then some users nevertheless receive the default welcome message.

Untrue, you can customize in both cases. Just not to your satisfaction.

Simply customize all affected locales, this already works.

Since you cannot exclude any locales, that would be “all locales”, which brings us back to

Why not just customize it in the ~4 most common languages after English? Surely you’re not going to have users speaking American Cherokee Indian anytime soon.

Yes, as I said, limiting the locales that users can choose would also solve the problem, albeit in an unnecessarily limiting way.

What do you think about @tgxworld’s proposal above?

I don’t know about this. A new user wouldn’t have had the chance to select her/his preferred locale before the welcome message is sent out. I’m pretty sure they are most likely going to get your customised message in the default locale of the site.

Unless you have set locale from accept language header turned on :wink:
Or if users choose to respond to the bot after they have customized their locale (though that would not concern the welcome message)

「いいね!」 1

If you’re knees deep into customisations, wouldn’t it be better to just turn off set locale from accept language header ? Even with my proposed fix for your use case, they are going to end up getting the welcome message in the default locale of your site. I don’t feel very strongly about this and like @codinghorror said, customising the welcome message for the 4 next common languages would be good enough.

「いいね!」 1

Yes, I did that, of course, when I realized the consequences. But I think it’s a really great setting for multi-lingual sites because it immediately sends a message to new users when they first visit the site. In fact, even on mono-lingual sites, people who are not native speakers of the site language might be attracted by having the UI in another language.

Yes, unless their browser locale is in one of the languages for which I customized the message. But that, I think, is fine because on the plus side, what users get is the whole UI in their language. You can’t have it all. And you might even speculate that if that UI brings more people from that language community to my forum, chances are that eventually someone helps translate the welcome message (or whatever else is missing).

Since this would also require a new feature (limiting which locales are available on a site) I guess it’s a matter of cost/benefit calculation. The benefit of limiting user locales would be tangible but rather limited and with negative side effects (but still a viable solution). The benefit of your suggestion would be great and would increase in time as more discourse locales become available. So, in my mind, it is clearly the better solution in terms of benefit and openness for future development.

I have no clue about the cost dimension. Could you add it to the equation?

SInce this topic has been somewhat inconclusive I’d like to return to what I think was an excellent suggestion:

This would be immensely helpful and as far as I can tell (which is not very far) it’s probably a rather easy thing to accomplish. Any chance that this could get implemented?

Just to reiterate why this is useful, since the discussion above is somewhat complex: basically, it solves the problem that once you customize any text element in your site’s default language, you can no longer allow users to choose their own locale (let alone enable set locale from accept language header) because they will be seeing the default texts in their respective language and those will no longer correspond to the texts in the site’s main language.

I should add one important detail to the proposed solution:

if you customize a translation of the default site locale, all the other locales should treat its corresponding translation text as missing unless the translation text has also been customized

In other words: if my site is in English and I customized a specific text in English but also in French, all locales will fall back to the default locale for that specific text except for the French locale, (because it has also been customized so that a correspondence between the translations can be assumed).

「いいね!」 5

Any news on this? I’d love to know if this is planned in any way:

If it’s not planned, could someone give an indication of what kind of work would be required to implement this?

To me it looks like what is needed is an routine that is activated whenever a page is served in a language other than the site’s default language. That routine would check if any of the text elements on that page have been modified in the default locale. If not, exit. If yes, it checks if they have also been modified in the current language. If yes, exit. If no, serve the text in the default language.

Alternatively, instead of checking things every time a “foreign” page is served, all current procedures could be left unchanged and instead changes are made whenever default texts are customized. For example, whenever a default text is modified in the default language, all default copies of all other languages are deleted so that the default text will be served (or will it?)

That latter option has quite some pitfalls though, because you need to make sure that only default copies are deleted, not modified ones. And what happens if the default translation is updated on transifex? That should not lead to the copy magically reappearing when the discourse instance is upgraded.

So the first option is probably the better one, but I have no idea how much extra resource use it would imply for serving pages in a foreign language…

「いいね!」 1

@tophee Did you find a solution to this? I’m currently looking at how to restrict the locale list. If there is no solution yet, I will look to implement on… Thanks in advance for your feedback

The solution is here:

But I don’t think it has been implemented yet.

「いいね!」 1

I suppose @tgxworld’s fix is low priority? Or is it on the roadmap at all?

I don’t think I’m able to implement this myself but I’m thinking of maybe trying a kind of brute-force solution by simply deleting (or making unaccessible) all locales that I don’t want to customize (and hence want to prevent people from using).

Could someone give me a hint as to how to gi about tbis? I’m guessing that I need a rather simple plugin that “breaks” the unwanted locales?

「いいね!」 3

@tophee 古いトピックを掘り起こして申し訳ありませんが、最近多言語サポートに多く取り組んでいるため、ここであなたが何を言おうとしているのか、もう少し詳しく理解したいと思っています。

正直なところ、なぜあなたが提案する解決策が、カスタマイズされたテキストをユーザーのそれぞれの言語に翻訳するよりも優れたユーザー体験なのか、少し混乱しています。

多言語フォーラムのユーザーにとって、フォーラムのデフォルト言語で自動メッセージの一部が表示され、一部は自分の言語で表示されるのは奇妙な体験に思えます。しかし、もしかしたら私の理解が間違っているのかもしれません。

いずれにせよ、Multilingual Plugin 🌐 を使用して、利用可能なインターフェース言語の数を制限できるようになりました。

「いいね!」 8

わあ、素晴らしいですね。できるだけ早く詳しく見てみます。

リソース制約のない完璧な世界であれば、もちろんすべてを翻訳する方が良いでしょう。しかし、私が解決しようとした問題は、カスタマイズされたテキストをすべての言語に翻訳する必要がある(ユーザーにどの言語を提示するかを制限することができないため)という点です。もしあなたのプラグインがそれを解決するなら、前述したように大きな進歩です。

私が「負の副作用」と言っているものを明確にします。Discourse が 30 (?) 言語に翻訳されていることは、それらの言語を話す人々にとって素晴らしいことです。したがって、これらのユーザーにそれらの言語のほとんどを選べなくすることは不利になります。言い換えれば、ある言語を許可するためには、その言語にカスタマイズされたテキストを翻訳できなければなりません。

そこで私が提案したのは、テキストがデフォルト言語でカスタマイズされた場合、そのテキストを表示する際に、他のすべての言語はデフォルト言語にフォールバックする(ただし、その言語にもカスタマイズされたコピーがある場合は除く)ようにすることです。

「いいね!」 1

はい、おっしゃることは理解しました。

ただし、ユーザーの最も一般的な言語に絞るのではなく、カスタマイズされたテキストを「すべての」言語に翻訳することに、過度に重点を置いているのではないか疑問に思います。

シミュレーションしてみましょう。この話題は具体例で説明した方がわかりやすいと思います。

ベルギーを拠点とするサイクリング :bike: に関するフォーラムがあるとします。ユーザーの95%は、オランダ語 :netherlands:(40%)、フランス語 :fr:(30%)、ドイツ語 :de:(15%)、または英語 :uk:(10% - 観光客)のいずれかを話しています。残りの5%は、他の言語の混在です。フォーラムのデフォルト言語はオランダ語です。

ここで、カスタマイズされたボットのテキストをオランダ語だけで設定し、他の言語への翻訳は「フォールバック」機能に任せて、すべてのユーザーにオランダ語のカスタマイズ版を表示するとします。技術的には全員同じテキストが表示されますが、フォーラムのユーザーの60%はそれを理解できないか、部分的にしか理解できません(さらに、フランス語やドイツ語話者には「フラマン語圏」のフォーラムだと感じられるかもしれません)。

逆に、ネイティブスピーカーである数人のモデレーターやパワーユーザーの助けを借りて、カスタマイズされたウェルカムテキストをフランス語、ドイツ語、英語にも翻訳し、「フォールバック」機能を使用しないとします。すると、フォーラムのユーザーの95%が、完全に理解でき、親しみを感じられる言語でカスタマイズされたテキストを目にすることになり、残りの5%のみが異なるテキストを表示することになります。

このようなシナリオでは、フォールバック機能は5%のケースに対して有用かもしれませんが、より大きな課題は、少数のユーザーが異なるテキストを見ることではなく、カスタマイズされたテキストを、最も一般的に使用される数言語に翻訳することにあるように思われます。

「いいね!」 4