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 Inlang to enable community translations / make the contribution of translations easier #662

Merged
merged 9 commits into from
Jan 28, 2023

Conversation

jannesblobel
Copy link
Contributor

@jannesblobel jannesblobel commented Jan 25, 2023

Hej @Andrew-Chen-Wang, @samuelstroschein mentioned that you are informed about this pull request. If there are any problems with the PO plugin, hit me up.

Description
This pull request adds the possibility for contributors and translators to manage translations in a UI instead of files with no overhead for the maintainers.

Preview
The changes of this PR and a live instance of the editor can be previewed with the following link djangorestframework X inlang editor
Note: This link should be changed to point to djangorestframework instead of jannesblobel after this PR has been merged.

Limitations

  1. Certain actions are slow
    Inlang is running entirely on git, giving tremendous CI/CD and contribution power to localization (and potentially other verticals -> the next git). That means that the whole djangorestframework repo is cloned into the browser which makes certain actions like the initial load and pushing changes slow. Those limitations will be fixed with future releases and require no input from djangorestframework.

  2. Linting is not available yet
    Neither the editor nor developers will receive linting and validation tools for translations with this PR (yet). Some commits that I have done removed unused translations. In the future, spotting errors like unused translations could be achieved with the planned inlang CLI via CI/CD, see https://github.com/orgs/inlang/discussions/273. In the meantime, manually spotting and fixing errors in translations is required :(

@Andrew-Chen-Wang
Copy link
Member

there's seems me a space right after LC_MESSAGES.

@jannesblobel
Copy link
Contributor Author

there's seems me a space right after LC_MESSAGES.

You are right. Thank you.
I removed the whitespace. Let me know if there are more mistakes :)

@Andrew-Chen-Wang
Copy link
Member

can you fill in the english strings please. Please use inlang and open a separate PR (will merge once I see a valid PR of the en lang file filled in). Before you do, please delete the en file here and test to see whether a new language is created. Thanks!

Also for inlang, I think it would benefit if you could put the url in the readme near the bottom under a sub header labeled translations.

direct users to either 1) contribute directly or 2) use inlang

@samuelstroschein
Copy link

@jannesblobel is the en file auto-generated via CI/CD, or manually? If manually, how will the file keep in sync with the messages used in the source code?


return {
referenceLanguage: "en",
languages: [
Copy link
Member

@Andrew-Chen-Wang Andrew-Chen-Wang Jan 26, 2023

Choose a reason for hiding this comment

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

Does inlang also make a PR to change this config file when a translator has a new language to add? Want to decrease maintainer effort such that a new issue doesn't need to appear just to ask maintainers to add a new language + use inlang.

Choose a reason for hiding this comment

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

Not yet, see the ongoing discussion at opral/monorepo#276.

Adding a new language would require modifying the source code. Inlang does not adjust source code right now and thereby eliminates the risk to create bugs in source code. That said, this feature is wanted (upvote it, if you want it too). Needs elaboration on how to implement such a feature.

@jannesblobel
Copy link
Contributor Author

jannesblobel commented Jan 26, 2023

Hi @Andrew-Chen-Wang
I changed:

  • I have deleted the previously created en files. The reason is that the files are no longer needed

  • add a call to "contribute to the translation" to the readme

The PR is ready to merge.
Apologies for the extra effort

@Andrew-Chen-Wang
Copy link
Member

pre commit lint failing

@jannesblobel
Copy link
Contributor Author

I hope, I fixed it with my last commit #3351d5e.

Unfortunately, this was the first time I had worked with rst files before, and I needed to find out the underline length of a headline. Typical Copy/Paste mistake and Github rendered my rst Readme. That's why I thought the readme worked

I tried to test the file before I committed it, but I didn't find a linter for rst files that work on my computer.

@Andrew-Chen-Wang
Copy link
Member

No worries. We use a Python package called pre-commit where you install it andd run pre-commit install so it'll automatically lint for you. Thanks for the PR!

README.rst Outdated Show resolved Hide resolved
@Andrew-Chen-Wang Andrew-Chen-Wang merged commit e67944a into jazzband:master Jan 28, 2023
@samuelstroschein
Copy link

🥳

CleanShot 2023-01-28 at 20 28 59@2x

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.

3 participants