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

i18n: Add compatibility for Transifex (industry standard provider for open source translations) #5341

Open
gcushen opened this issue Oct 23, 2018 · 12 comments

Comments

@gcushen
Copy link

gcushen commented Oct 23, 2018

Problem

Popular themes for Hugo, such as Academic, offer language packs to enable users to easily change the interface language to their native language.

Currently, the format used for Hugo's YAML language packs is incompatible with leading open source translation providers, such as Transifex.

Thus, Hugo language packs are currently very difficult to manage (Academic has over 18 languages), difficult to keep in sync with the master language file, and without the ability to perform translations via the key open source translation providers.

Proposal

Restructure the YAML language file into a standardized format in order to align it with the standardized form used by other major open source projects (e.g. django-rest-framework).

This would make Hugo and its themes compatible with existing language pack translation management tool such as Transifex, the industry standard provider of language translations for open source projects.

@gcushen gcushen changed the title i18n: Add compatibly for Transifex (industry standard provider for open source translations) i18n: Add compatibility for Transifex (industry standard provider for open source translations) Oct 23, 2018
@bep
Copy link
Member

bep commented Oct 23, 2018

"Transifex is a proprietary, web-based translation platform;"

https://en.wikipedia.org/wiki/Transifex

I see very little "open source" in that project/product?

@gcushen
Copy link
Author

gcushen commented Oct 23, 2018

It's the leading provider of free translations for major open source projects.

@bep
Copy link
Member

bep commented Oct 23, 2018

major open source projects.

Name a few.

@gcushen
Copy link
Author

gcushen commented Oct 23, 2018

I named one major one, I know many other major OS projects using it, will list them in a bit :)

@gcushen
Copy link
Author

gcushen commented Oct 23, 2018

Here's a comprehensive list (43 million references to Transifex in GitHub code :D ): https://github.com/search?q=transifex&type=Code

@gcushen
Copy link
Author

gcushen commented Oct 23, 2018

To summarize, this includes edX, Kodi, and pretty much all the other big open source projects that offer some kind of text interface.

@bep
Copy link
Member

bep commented Oct 23, 2018

OK, thanks.

I have thought about this in the past -- and here is my thought about how we could add support for other formats:

  • Add adapter that converts (internally in Hugo) to go-i18n's data format.
  • It should be possible to detect what adapter to use either by filename or by looking at the content
  • This way different formats can live side-by-side

A nice addition to the above (but harder to implement) is a converter the other way.

@gcushen
Copy link
Author

gcushen commented Oct 23, 2018

The v2 beta of go-i18n has just been released and supports a new flatter YAML language file format which at first glance appears to offer compatibility with translation providers like Transifex - see nicksnyder/go-i18n#85

Perhaps we could consider just moving to this significantly more popular format which is now supported by go-i18n. My other recent proposal (#5342) would help prevent breaking user's sites.

@stale
Copy link

stale bot commented Feb 20, 2019

This issue has been automatically marked as stale because it has not had recent activity. The resources of the Hugo team are limited, and so we are asking for your help.
If this is a bug and you can still reproduce this error on the master branch, please reply with all of the information you have about it in order to keep the issue open.
If this is a feature request, and you feel that it is still relevant and valuable, please tell us why.
This issue will automatically be closed in the near future if no further activity occurs. Thank you for all your contributions.

@stale stale bot added the Stale label Feb 20, 2019
@bep bep added the Keep label Feb 20, 2019
@stale stale bot removed the Stale label Feb 20, 2019
@eighthave
Copy link

Ideally, Hugo would just use one of the plethora of existing, standard, full-featured formats that are supported by lots of translation platforms. For example, Weblate is actually free software and many software packages are translated on it. Here are the formats it supports: https://docs.weblate.org/en/latest/formats.html

Using something like Chrome/WebExtensions JSON seems like a good bet:

@eighthave
Copy link

I just looked at go-i18n, it supports JSON/YAML formats that have has some decent support (basically, key/value pairs with one or two levels of nesting):

weblate:
  hello: ""
  orangutan": ""
  try": ""
  thanks": ""

@eighthave
Copy link

Mozilla is switching Firefox and many other of its projects to its Fluent 1.0 format, which extends on what gettext and XLIFF offer. They already have parsers in Javascript, Python, and Rust, so writing a Go parser shouldn't be too hard. They are pushing this format for websites also, so it could make sense for Hugo also. I haven't used it myself though.

https://hacks.mozilla.org/2019/04/fluent-1-0-a-localization-system-for-natural-sounding-translations/

@bep bep added this to the v0.131.0 milestone Jul 30, 2024
@bep bep modified the milestones: v0.131.0, v0.133.0 Aug 9, 2024
@bep bep modified the milestones: v0.133.0, Unscheduled Aug 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants