Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Hungarian localisation #5902

Open
wants to merge 25 commits into
base: main
Choose a base branch
from
Open

Conversation

smileyhead
Copy link

I have 8 years of localisation experience, but this is the first time I've tackled a social network, so feedback is very welcome.

I also have some questions/notes:

  • Is there a way to get notified of any changes before build-time? I would like to avoid the localisation always being one version behind, with all the new text left untranslated, if possible.
  • I have removed the special plural formatting, as Hungarian doesn't use plurals when counting. I hope this is acceptable.
  • I have translated all ‘# minutes,’ ‘# hours,’ etc. strings as ‘# minutes ago,’ ‘# hours ago,‘ etc., since these alternate forms are achieved with suffixes in Hungarian and it would be impossible to separate them. Are they used in any other way? If so, would it be possible to make unique strings for other cases?
  • Will there be a possibility to translate Bsky-associated content, like the name/description and (most importantly) categories in the Bluesky Moderation Service, as well as the names/descriptions of first-party feeds?

Thank you in advance.

@auroursa
Copy link
Contributor

auroursa commented Oct 22, 2024

It works well for me.

2024-10-22 23 06 54
  • It seems that after removing the plural, like time and others work properly.

  • You can safely translate terms like “hours” to “hours ago”, as far as I know, there aren’t other usages. I did the same in Chinese translations as well.

  • Update the translation strings by running yarn intl:extract --locale hu each time manually, then you can get translation updates instantly. By the way, usually, there’s no need to translate strings starting with #~ as they have already been deprecated.

Shortened Media tab title
Added spaces to the short timestamps (mp, p, ó, n, hó)
@smileyhead
Copy link
Author

Thank you very much for your feedback and your screenshot – I've made some small tweaks thanks to the latter.

Where and when exactly should I run the yarn intl:extract --locale hu command, if I may ask?

@smileyhead
Copy link
Author

Hmm, I've just looked closer at your screenshot and noticed that the ‘Liked by # users’ string did actually break. I wonder how to fix it…

image

@auroursa
Copy link
Contributor

Thank you very much for your feedback and your screenshot – I've made some small tweaks thanks to the latter.

Where and when exactly should I run the yarn intl:extract --locale hu command, if I may ask?

First need to set up a local build environment, including tools like Node.js (following the build instructions).

Typically, if you only need to test translations on the web, just need Node.js and Python, and make sure to add them to your system’s PATH.

After that, run yarn install and wait for a bit—long enough to enjoy a cup of coffee. Once the local setup is ready, execute yarn intl:extract --locale hu, and you’ll see the output like this:

2024-10-22 23 35 51

It will update the messages.po file, and then you can use an appropriate tool to fill in any missing translation strings.

After completing the translation of the messages.po file, you can run yarn intl:compile to generate the correct target translation files. Then, execute yarn web to see the results.

That's it. Good luck and wishing you all the best.

@smileyhead
Copy link
Author

Thank you very much.

In the meantime, I believe to have deciphered the proper formatting of the plural strings and have applied a possible fix.

@auroursa
Copy link
Contributor

You’re right, it seems that there’s no need to introduce plural strings at all for it to work.

截屏2024-10-22 23 52 27

@smileyhead
Copy link
Author

Thank you very much!

@smileyhead
Copy link
Author

I was able to build and locally test the web app for myself, and fixed any glaring issues I could find. I think the localisation is now ready for a first implementation.

Something I found out about plural strings while testing:
There are two types. Those that have a # included in the string part and those that do not. Only the former kind needs to keep the variable, as the latter is used in places where the number is already rendered before the string, like the followers/following counters on profile pages. If you do leave them in, they will display like this:

27 27 followers

So, to summarise, when removing the plural syntax, only keep the number variables if there's a # in the source string:
{0, plural, one {like} other {likes}}likes
{0, plural, one {# like} other {# likes}}{0} likes

Copy link
Contributor

@surfdude29 surfdude29 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If it's desirable to have a space in the translations of these narrow forms, I think it would be best to use a non-breaking space to make sure that the two elements are shown together :)

EDIT: On second thought, while I'm pretty certain this wouldn't hurt, perhaps it's not actually necessary? I'm really not sure tbh, as I don't believe that translations in other languages so far have used a space in these strings 🤔

src/locale/locales/hu/messages.po Outdated Show resolved Hide resolved
src/locale/locales/hu/messages.po Outdated Show resolved Hide resolved
src/locale/locales/hu/messages.po Outdated Show resolved Hide resolved
src/locale/locales/hu/messages.po Outdated Show resolved Hide resolved
src/locale/locales/hu/messages.po Outdated Show resolved Hide resolved
@smileyhead
Copy link
Author

Honestly, adding a space was just a stylistic choice at the time, but now I've checked Twitter and Facebook and it turns out they both do use spaces in Hungarian as well. The addition of non-breaking spaces is a good idea, though. Thank you for that.

smileyhead and others added 2 commits October 24, 2024 00:22
Co-authored-by: surfdude29 <149612116+surfdude29@users.noreply.github.com>
Co-authored-by: surfdude29 <149612116+surfdude29@users.noreply.github.com>
smileyhead and others added 3 commits October 24, 2024 00:23
Co-authored-by: surfdude29 <149612116+surfdude29@users.noreply.github.com>
Co-authored-by: surfdude29 <149612116+surfdude29@users.noreply.github.com>
Co-authored-by: surfdude29 <149612116+surfdude29@users.noreply.github.com>
@surfdude29
Copy link
Contributor

This looks like a great effort, nice work! 👌

I see that @auroursa has already been very helpful in answering questions and giving feedback :)

I just wanted to note a few other things:

  • Will there be a possibility to translate Bsky-associated content, like the name/description and (most importantly) categories in the Bluesky Moderation Service...

It looks like you've translated the four "global" content labels like Adult Content, Sexually Suggestive, etc, so if you're asking if you can translate all the other labels on the profile page for the Bluesky Moderation Service: unfortunately, that isn't possible yet.

...as well as the names/descriptions of first-party feeds?

Disappointing answer here too, I'm afraid, as Discover and Following are currently hardcoded in English.

And finally, one important thing to mention is that the devs usually ask to have at least one native speaker review a localization before merging it. Would it be possible to ask another Hungarian speaker to do that review?

Once they've done their review, my completely unofficial opinion as a fellow translator is that this PR would look in a good position to be merged 🚀

@smileyhead
Copy link
Author

Thank you so much. I've asked my friend, @SonoSooS to help with proofreading – he should report back soon™.

Copy link
Contributor

@auroursa auroursa left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I found that specifying it as {0} does not display the count correctly.
image

src/locale/locales/hu/messages.po Outdated Show resolved Hide resolved
src/locale/locales/hu/messages.po Outdated Show resolved Hide resolved
smileyhead and others added 2 commits October 24, 2024 08:11
Co-authored-by: Frudrax Cheng <i@cynosura.one>
Co-authored-by: Frudrax Cheng <i@cynosura.one>
@auroursa
Copy link
Contributor

Thanks @surfdude29 for the additional information. I feel frustrated about the inability to translate "Following," "Discover," and the Bluesky Moderation Service list, as this has been an issue affecting the Chinese translation as well.

But hey yes, I would say that technically this PR looks ready to merge🤗

Look forward to other Hungarian native speakers helping to refine the translation. You're doing a great job!

@SonoSooS
Copy link

We went through it with @smileyhead, and correct some things that - while correct - felt really unnatural, like short "ago" units for example. Those may work in other languages, but not here. Otherwise yeah, he did a fantastic job, as usual.

However, there are some "dialect" issues that we couldn't agree on, so I'll list them here, just in case stylistic "overrides" are preferred over language correctness.

  • pagination order, forwards "2/3" ("2nd page out of 3" (basically the same word order as in Hungarian)) vs. backwards "3/2" ("2nd out of 3 pages" (the spoken order is with the 3 first, then 2, so this one rolls off the tongue)). This one is very much so a mixed bag. Some people prefer "3/2", and others (like myself) utterly despise it, and prefer the "2/3" one. He even asked linguistics, and they said, that there is no rule for this. Media uses the backwards format, but most (but not all) people that I know around me use the forwards format. A lot of people will be displeased, no matter which one gets hardcoded.
  • couldn't agree on whether to use "alsókötőjel" or "alulvonás" for the underscore (_). I have never heard of anyone using "alsókötőjel", and I've been from barely inhabited remote villages with "dialects" almost impossible to understand, to big cities, and I have never in my life heard the word "alsókötőjel", everyone I have ever met calls it an "alulvonás". However, according to Wikipedia, it is officially called "alsókötőjel", but in everyday language we say "alulvonás" for sure.
  • this is not a problem with his translation, but there is no thousands separator for big numbers (for example 5-digit follower count). The official thousands separator here is the dot (.), but basically every website uses space ( ) as a thousands separator instead. Personally I prefer the comma (,) for readability though, but then there is a possibility of people confusing it for a decimal separator, so it sadly can not be used.

We also found a bunch of usability issues, but those have nothing to do with this PR, I'll report those separately.

@smileyhead
Copy link
Author

The official thousands separator here is the dot (.), but basically every website uses space ( ) as a thousands separator instead.

Correction: The main thousands separator is a space, and the second option is a dot (and we use a decimal comma).
So, yeah, a long number with digits would look like this: 12 345. But for some reason, the site displays them as 12345.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants