-
Notifications
You must be signed in to change notification settings - Fork 194
FEATURE: Switch from flags to language names #61
Comments
Sorry for the confusing label. Initially thought this would become a feature request. |
For English, I created a merged flag under In my opinion, the Language flags are more for a visual representation of the main language. I have seen merged USA/GB flags, but rarely merged other flags. If we feel like this is a big deal, it would be worth exploring, but ultimate, the languages are "English" and "German". That being said, I am open to having a conversation about it. |
Does using 'at' as locale have any negative impact for site users? For example because their browser does not choose the right language automatically. Although it seems a picky I do not really feel comfortable with using the German flag instead. After all it is a personal blog and I am not from Germany. This is especially true since 'Austrian German' can be quite different from German German. For creating a merged flag you would need also to include Switzerland, since they speak German there as well, so it would get quite crowded in there ;) Another workaround could also be to just add an option to disable the flags and have a language dropdown or something. But as I said, if my workaround has no negative impact then I am fine with that. |
After thinking a little further, the easiest solution would be to add different locales to the hugo-future-imperfect-slim/static/css/main.scss Lines 761 to 773 in 6453583
Your example would add:
That being said, if you are not translating your blog, you should just turn multilingual off and remove the flags. Either by disabling languages:
or completely removing them from the hugo-future-imperfect-slim/exampleSite/config.toml Lines 139 to 255 in 6453583
|
@twatzl Born and raised in 🇭🇰, a former 🇬🇧 British colony, I share similar feelings. Three months ago, a GitLab issue to merge Traditional Chinese locales 🇭🇰 zh-HK and 🇹🇼 zh-TW caused a storm in the teacup: https://gitlab.com/gitlab-org/rgitlab-ce/issues/60768. It would be great if you could offer us some translations, even a few locale strings. They can be put into a pull request, which will be merged upon completion. The PR for Spanish translation #52 is an example.
😃 Good point! As a native 🇭🇰 Cantonese speaker, I can't agree with you more. The case for Chinese is even more illustrating: 🇲🇴 & 🇭🇰, 🇹🇼, 🇸🇬 & 🇲🇾. Perhaps we can learn how to handle different locales from Minimal Mistakes: https://github.com/mmistakes/minimal-mistakes/blob/43b5e5f2ef115f3467fd4fa7256ca38953d5e993/_data/ui-text.yml#L518-L529. If you really want to edit the SCSS rules, please be aware of the file path change in |
@pacollins what about defining the flag string in the translation file? Because flag-icon-at already exists and works when you just name the translation file at.toml instead of de-AT.toml. This would basically resolve all those corner cases at once. And in the *.toml file you would just define the flag with And yes @pacollins I am using multilanguage feature. I write in German and English. This was the main reason why I switched from Hexo to Hugo and to this theme. @VincentTam How would you recommend doing the translations? Should I just provide the same files for Austrian and German. After all the translations would probably be identical except for the flag. (The local varieties of the language are mostly different in the words for certain foods) Should I just add 2 files with almost identical content? |
I'm not (yet?) familiar with the working of the flag feature, so I'll leave @pacollins to respond.
Why not? TL;DRIn this case, developers would normally use one single Having language + regional codes in |
Ok. Fine. But I am going to wait until we have a proper approach for fixing the flag. I don't want to create a PR with a workaround. :D |
@twatzl Wouldn't doing EDIT: Unless you meant |
After experimenting, Hugo does not recognize
So this might be an issue to push further up the chain. |
The work around that you are using seems to be appropriate based on my usage. For the line below, Hugo requires it be an ISO 639-1 Code which are 2 letter codes (eg.
Then for the below lines, you can actually define it however you want. For example, you can replace hugo-future-imperfect-slim/exampleSite/config.toml Lines 147 to 152 in afbf3cc
That being said, I am going to close this issue because the current solution does not require changing the theme. It might be worthwhile posting an issue on the Hugo repo though about them expanding applicable language/locale codes. Thanks for the brain teaser here and I hope this gives you some closure. 😄 Feel free to continue the discussion here though, if needed. |
🤦♂️Cantonese isn't found in the linked list, but in ISO 639-3. Anyways, just a comment. Most Cantonese speakers can read from either 🇹🇼 zh-TW or 🇨🇳 zh-CN. |
You could also stop using flags to represent languages. |
@pacollins I've started a question on Hugo forum. I've got a reply that Hugo actually support lang+country code from https://discourse.gohugo.io/t/i18n-support-for-language-country-code/20303/4?u=vincenttam. As a result, we might keep the flags. Here's the code in TOML. Try:
|
@VincentTam Let's explore that and see how it looks. @martignoni I understand the sentiment, but its more about easy of access. Across the internet this is a common feature people are used to using. That being said, I am open to a suggestion as a replacement as long as it isn't an eyesore. |
@pacollins Re: flags do not represent languages. E.g. my country (Switzerland) has four official languages, but only one official flag. So it's maybe more than a sentiment. Anyway, you're right that the practice to use flag for languages is relatively spread in the Internet. So why not take this opportunity to make the Internet better? :-) Some best practices here: http://www.flagsarenotlanguages.com/blog/best-practice-for-presenting-languages/. And here's how I'm doing it in one of my (Hugo based) websites. |
Wouldn't that ultimately lead to the same issue as the original report? Or
would you recommend doing Deutsch-AT (or similar)?
…On Mon, Aug 19, 2019 at 8:50 AM Nicolas Martignoni ***@***.***> wrote:
@pacollins <https://github.com/pacollins> Re: flags do not represent
languages. E.g. my country (Switzerland) has four official languages, but
only one official flag. So it's maybe more than a sentiment. Anyway, you're
right that the practice to use flag for languages is relatively spread in
the Internet. So why not take this opportunity to make the Internet better?
:-)
Some best practices here:
http://www.flagsarenotlanguages.com/blog/best-practice-for-presenting-languages/
.
And here's how I'm doing it in one of my (Hugo based) website.
[image: lang]
<https://user-images.githubusercontent.com/421392/63266210-b5ef9500-c28f-11e9-910d-8135e50490ea.png>
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#61?email_source=notifications&email_token=ACWVJSJO2L5J5W4Y4RBMGBTQFKJHRA5CNFSM4IMAQDZKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD4SZX2Q#issuecomment-522558442>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/ACWVJSIWJCPGCA6XUJE6RALQFKJHRANCNFSM4IMAQDZA>
.
|
I would imagine a menu similar to this:
And possibly, if there's only one language variation, omit the info in the parenthesis. |
@pacollins I am using at.toml. Probably I did not experience the issues you describe, because I am still using English as the main language for my blog and German just as secondary. I think a menu as described by @martignoni would look nice. I don't see why the language choosing menu has to take up the entire right side anyway. Regarding the issue of differentiating between languages in the written menu: I don't think this problem exists. The flag problem only exists, because I am Austrian and not German, but the language is still called German and nobody will translate it in all 3 languages. I have no idea how that is with other languages, but I think it is still save to say that either the languages are similar enough to be called the same and don't need translation or are different enough to have their own names. |
So you'd be fine with ignoring locales and just saying the overarching
language? That should be pretty easy.
It's a sliding side bar for stylistic consistency. We don't currently have
any dropdown menus, so it wouldn't make sense.
…On Mon, Aug 19, 2019, 3:39 PM twatzl ***@***.***> wrote:
@pacollins <https://github.com/pacollins> I am using at.toml. Probably I
did not experience the issues you describe, because I am still using
English as the main language for my blog and German just as secondary.
I think a menu as described by @martignoni <https://github.com/martignoni>
would look nice. I don't see why the language choosing menu has to take up
the entire right side anyway.
Regarding the issue of differentiating between languages in the written
menu: I don't think this problem exists. The flag problem only exists,
because I am Austrian and not German, but the language is still called
German and nobody will translate it in all 3 languages. I have no idea how
that is with other languages, but I think it is still save to say that
either the languages are similar enough to be called the same and don't
need translation or are different enough to have their own names.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#61?email_source=notifications&email_token=ACWVJSIFPMYWL6HOWMQVHHLQFLZFLA5CNFSM4IMAQDZKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD4UCFUI#issuecomment-522724049>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/ACWVJSKNI7ZSOGLWBLDWLKDQFLZFLANCNFSM4IMAQDZA>
.
|
@twatzl Luckily, someone has already translated most of the UI strings for us: I've put this into #75. As I don't know German, I'm open to changes.
Despite the similarities of these languages, I'm fine with creating locales like I'll keep an eye on this because of my native written language: defaultContentLanguage = "en"
[languages]
# Labelled "Chinese" for "Simiplified Chinese", no "Traditional Chinese" support
[languages.zh]
weight = 1
languageCode = "zh-CN"
[languages.en]
# … can cause sentiments, 👎 dislikes and complaints from thousands of netizens from these regions in case of big projects like GitLab: https://gitlab.com/gitlab-org/rgitlab-ce/issues/60768.
@martignoni LGTM, but @pacollins has the final say. |
I will defer to @VincentTam to the solution here. As an American, seeing
the English flag to represent English doesn't offend me, so I'd venture
that my opinion doesn't accurately reflect your concerns. My concern is
more the aesthetic of the theme and how we implement whatever we decide.
So @VincentTam, your call. Once we decide what we are doing, I'll comment
from the design side.
…On Tue, Aug 20, 2019 at 10:36 AM Vincent Tam ***@***.***> wrote:
@twatzl <https://github.com/twatzl> Luckily, someone has already
translated most of the UI strings for us:
https://github.com/marcelkraus/twietesla/blob/978fe99689adc1c38ce064f474ca554dfbcdfc1f/i18n/de.toml
.
I've put this into #75
<#75>. As I
don't know German, I'm open to changes.
Regarding the issue of differentiating between languages in the written
menu: I don't think this problem exists. The flag problem only exists,
because I am Austrian and not German, but the language is still called
German and nobody will translate it in all 3 languages. I have no idea how
that is with other languages, but I think it is still save to say that
either the languages are similar enough to be called the same and don't
need translation or are different enough to have their own names.
Despite the similarities of these languages, I'm fine with creating
locales like de-AT.toml, de-DE.toml, de-CH.toml, etc, but I'm
experiencing technical issues in the linked Hugo Forum thread:
https://discourse.gohugo.io/t/i18n-support-for-language-country-code/20303/4?u=vincenttam
.
I'll keep an eye on this because of my native written language: zh-TW 🇭🇰,
which is quite different from zh-CN 🇨🇳. Dropping support for anyone of
these
defaultContentLanguage = "en"
[languages]
# Labelled "Chinese" for "Simiplified Chinese", no "Traditional Chinese" support
[languages.zh]
weight = 1
languageCode = "zh-CN"
[languages.en]
# …
can cause sentiments, 👎 dislikes and complaints from thousands of
netizens from these regions in case of big projects like GitLab:
https://gitlab.com/gitlab-org/rgitlab-ce/issues/60768.
I would imagine a menu similar to this:
- English (UK)
- English (US)
- Deutsch (AT)
- Deutsch (DE)
- Deutsch (CH)
- Français (FR)
- Français (CA)
- Français (CH)
And possibly, if there's only one language variation, omit the info in the
parenthesis.
@martignoni <https://github.com/martignoni> LGTM, but @pacollins has the
final say.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#61?email_source=notifications&email_token=ACWVJSOCH5OI4J2ZXZTLKVDQFP6NZA5CNFSM4IMAQDZKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD4WQKOA#issuecomment-523044152>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/ACWVJSLKEQYAGXQ4DFVCPBDQFP6NZANCNFSM4IMAQDZA>
.
|
@pacollins @twatzl @martignoni I appreciate the @pacollins' effort in getting the flags displayed on our theme, but @martignoni's suggestion enables us to support more regional languages/dialects. After spending two days on improving our theme's Germany, French, Polish and Potuguese support in #75, I realized the technical difficulty in handling custom/regional I would further simplify @martignoni's menu into
(Edited: fixed careless mistake in "Portuguese". I meant the name of the language express in the language itself with it's ISO 639-1 lang code in brackets, followed optionally by country-code.) Untested suggestions: P.S. If anyone can show us how his/her regional locale is different from the existing one, we'll be happy to accept a PR. For example, the following way to representing dates is an American one. hugo-future-imperfect-slim/i18n/en.toml Lines 1 to 2 in 118943a
Someone might ask for support for 🇬🇧 UK-styled dates. In this case, the list would be
For backward compatibility, we might need Related Hugo Forum question: https://discourse.gohugo.io/t/i18n-support-for-language-country-code/20303/6 |
Sounds good. Lets go ahead and begin developing this change? (Volunteers? @twatzl? @martignoni? 😄) Once we get a framework set, I am happy to advice on the css.
@VincentTam - I don't think we will run into issues with backwards compatibility too much. I think in that case we will just release as a breaking change or find a way to create a pop-up warning when the site is |
Sure. If I find some time I'd be happy to help you. Do we have any means for communication other than this issue thread? @VincentTam Be careful with CSS dropdowns though. I used that with Hexo, before I ported my blog over to Hugo and they do not work on mobile (because there is no 'hover' event) and I spent a whole day trying to fix it, but could not manage to get it done. For this reason I would split it into 2 steps. Step 1 change the current menu from flags to languages, Step 2 change the sidebar menu to a dropdown. That way we can still decide to stick with the current solution if changing it causes too much trouble. |
I fully agree that there should be separate PRs.
We prefer to keep it all on GitHub for posterity (in case someone else has the problem). We aren't bothered by double comments or extra commits. That being said, if you really want another means, I can hook you up with my email. |
First two steps done in #80. Click to see the screenshot. I've never studied CSS, so what you see in the screencap is simply a temporary layout. |
Bug Report
Problem description
I am from Austria. Although we speak German here our language and culture is different from Germany in a few aspects.
Our official locale as far as i know is de-AT, but when I use that for the translation it tries to load the flag
flag-icon-de-at
which does not exist.Solution
A configuration possibility to configure the flag icon independently could solve the issue.
i.e.
Workaround
I just use 'at' now as locale. Now the flag works, but I am not sure what else I broke in the process of doing so.
The text was updated successfully, but these errors were encountered: