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

Allow passing your own translations when building CKEditor 5 #763

Open
Reinmar opened this issue Jan 8, 2018 · 17 comments
Open

Allow passing your own translations when building CKEditor 5 #763

Reinmar opened this issue Jan 8, 2018 · 17 comments
Labels
domain:i18n The issue reports a problem with internalization / translation mechanisms support:2 An issue reported by a commercially licensed client. type:feature This issue reports a feature request (an idea for a new functionality or a missing option). type:improvement This issue reports a possible enhancement of an existing feature.

Comments

@Reinmar
Copy link
Member

Reinmar commented Jan 8, 2018

Problem

Scenario:

  1. You want editor in language XY.
  2. You realise that XY's translations are completely missing or incomplete.
  3. You go to https://www.transifex.com/ckeditor/ckeditor5/
  4. You add there missing translations.
  5. But how can you use them to build the editor now?

The problem is that the process would need to have those additional steps:

  1. We run our tools to download translations from Transifex in the right format and commit them to all affected repositories.
  2. We publish all affected packages.
  3. A month later the developer is able to use the translations he/she added on Transifex.

This is just too slow and inconvenient. Therefore, we need to find some solutions for translating the editor by other developers. Also, we may think whether this wouldn't allow translating your own code which may be needed in international projects.

Solution

The easiest solution I can think of is allowing developers to pass additional PO file to CKEditor5WebpackPlugin. Developers should be able to put all missing translations (from all packages) in this file.

@AnnaTomanek @ma2ciek, does it sound reasonable? Or do you have other ideas?

There's one issue with this solution – when it will be so easy to translate CKEditor 5 for yourself people will be less inclined to sign into Transifex to fill those translations there too. But OTOH, tricking people to fill translations on Transifex when they can't use them for next month is not cool anyway.


If you'd like to see this feature implemented, add a 👍 reaction to this post.

@Reinmar Reinmar added status:discussion type:improvement This issue reports a possible enhancement of an existing feature. labels Jan 8, 2018
@Reinmar
Copy link
Member Author

Reinmar commented Jan 8, 2018

cc @wwalc too

@AnnaTomanek
Copy link
Contributor

I wouldn't be so afraid of scaring people away from Transifex, it's exactly the same difference that is between submitting a code fix in a PR to the official repository and just fixing your code locally - the same benefits (quick fix) and risks (not future-proof).

Whoever wants to help us will want to help us as long as it's easy enough and rewarding (be it through a "thank you" note from us or their own internal feeling of doing something to help others).

One note is that once you submit your translations to Transifex, you can download the translations as individual .po files for particular packages (resources) so we may want to think about any tips/tools to properly combine these files into whatever CKEditor 5 requires.

@Reinmar
Copy link
Member Author

Reinmar commented Jan 8, 2018

One note is that once you submit your translations to Transifex, you can download the translations as individual .po files for particular packages (resources) so we may want to think about any tips/tools to properly combine these files into whatever CKEditor 5 requires.

Our guide would say that:

  • If you miss translations, add them on Transifex.
  • Them, if you can't wait until the next release (which can be in a month time), download these PO files and configure CKEditor5WebpackPlugin to use them.

This way people won't have to understand the PO files syntax (which isn't super natural) and they will still be able to quickly build the editor despite outdated translations (on npm).

@ma2ciek
Copy link
Contributor

ma2ciek commented Jan 8, 2018

The easiest solution I can think of is allowing developers to pass additional PO file to CKEditor5WebpackPlugin. Developers should be able to put all missing translations (from all packages) in this file.

Maybe the JSON format would be easier for developers? Either way, it should be easy to implement.

Option to overwriting existing translations would be a little bit harder, but also doable.

@fabken
Copy link

fabken commented Jan 9, 2018

How can I configure CKEditor5WebpackPlugin to use my custom po files that I uploaded at transifex?

@ma2ciek
Copy link
Contributor

ma2ciek commented Jan 9, 2018

@fabken, we are discussing adding such an option to the CKEditor5WebpackPlugin to enable building editor with custom translations. For now, it's not available via the config.

If you uploaded translations on the https://www.transifex.com/ckeditor/ckeditor5/, then they will be available in our next release.

@wwalc
Copy link
Member

wwalc commented Jan 9, 2018

I wonder if offering one more thing would not make sense: a tool for the end users to fetch latest translations from Transifex. Like npm run pull-translations that would use the tx client to update po files. This way the translator could work in Transifex environment and use his changes immediately. That could be even reasonably convenient (or not).

Things I did not check:

  1. If user can pull translations from our project with his own API token or without issuing it at all.
  2. How stable https://www.npmjs.com/package/transifex eventually is.

@ma2ciek
Copy link
Contributor

ma2ciek commented Jan 9, 2018

AFAIR the API token provides, unfortunately, a root options for the whole account, but I don't know whether a user can download the whole package he contributes.

@ma2ciek
Copy link
Contributor

ma2ciek commented Jan 9, 2018

We could make a CS proxy for the readonly access to translations :D

@wwalc
Copy link
Member

wwalc commented Jan 9, 2018

AFAIR the API token provides, unfortunately, a root options for the whole account, but I don't know whether a user can download the whole package he contributes.

Can you confirm this, just to make sure? If you confirm it, could you ask Transifex support if they see any workaround for our use case?

@Reinmar Reinmar added this to the next milestone Sep 10, 2019
@ma2ciek
Copy link
Contributor

ma2ciek commented Nov 6, 2019

Can you confirm this, just to make sure?

I can confirm that for today there's only the Generate a Token button which creates a token, which allows usage of the whole Transifex API.

could you ask Transifex support if they see any workaround for our use case?

Yep, a little bit late, but still I can ask them 😅

@jswiderski
Copy link

Option to overwriting existing translations would be a little bit harder, but also doable.

We have users which would like to also overwrite existing translations. I think it would be extremely useful if users could create their own file or set of files with translations they want to change to add.

@ma2ciek ma2ciek added the type:feature This issue reports a feature request (an idea for a new functionality or a missing option). label Dec 9, 2019
@lslowikowska lslowikowska added the support:2 An issue reported by a commercially licensed client. label Dec 9, 2019
@7iomka
Copy link

7iomka commented Dec 9, 2019

Hi!
Currently it turns out that you don’t have the opportunity to let users override existing translations?
For example, I am doing a custom build.
In the latest version there is no translation in Russian for msgid "Show more items"
What are my options for translating this line?
I went to https://www.transifex.com/ckeditor/ckeditor5/translate/#ru/ckeditor5-ui
made a translation of this line there
And now what do I have to wait for the next release?
No other options?

@7iomka
Copy link

7iomka commented Dec 9, 2019

Wow, I found a way to override default currently unavailable translations with your own .po files in custom-build

image

@Reinmar
Copy link
Member Author

Reinmar commented Dec 16, 2019

Hm... Interesting :) Can you write a bit more about it? I think I know how you did this, but just to be sure – how does the structure of custom-translations/ directory looks?

@ma2ciek ma2ciek added the domain:i18n The issue reports a problem with internalization / translation mechanisms label Apr 10, 2020
@pomek pomek modified the milestones: next, nice-to-have Nov 10, 2020
@MuhammadAsadUllah821
Copy link

Wow, I found a way to override default currently unavailable translations with your own .po files in custom-build

image

Can u please explain more.

@7iomka
Copy link

7iomka commented Jan 13, 2021

@Reinmar, @MuhammadAsadUllah821
It was a long time ago and I forgot what I mean
but if that directory custom-translations structure
https://drive.google.com/file/d/1k6A9MDdcyglQcxH4-EGHPCGeqp3WrfSC/view?usp=sharing

@pomek pomek removed this from the nice-to-have milestone Feb 21, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
domain:i18n The issue reports a problem with internalization / translation mechanisms support:2 An issue reported by a commercially licensed client. type:feature This issue reports a feature request (an idea for a new functionality or a missing option). type:improvement This issue reports a possible enhancement of an existing feature.
Projects
None yet
Development

No branches or pull requests