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

feat: add ide-extension for i18next handling #3474

Closed
wants to merge 1 commit into from

Conversation

NilsJacobsen
Copy link

Let me know if I need to change something to merge this PR

I added the inlang IDE extension to sealos. Helps with handling translation keys and translation linting.

What did I add?

  • inlang.config.js to configure where language translations are
  • Would recommend adding it to the .vscode folder so other contributors can use it.

How to use it?

Extract Messages (translations)

Extract Messages (translations) via the Inlang: Extract Message code action.

Extract Messages

Inline annotations

You can see translations directly in your code. No back-and-forth looking into the translation files themselves. (code example from sealos)

image

Ootb editor & CLI if needed.

@cla-assistant
Copy link

cla-assistant bot commented Jul 6, 2023

CLA assistant check
All committers have signed the CLA.

@sealos-ci-robot
Copy link
Member

🤖 Generated by lychee action

Summary

Status Count
🔍 Total 844
✅ Successful 322
⏳ Timeouts 0
🔀 Redirected 0
👻 Excluded 521
❓ Unknown 0
🚫 Errors 0

Full action output

Full Github Actions output

@NilsJacobsen
Copy link
Author

Hey btw sealos has 16 erros (missingMessage/ referenceMessageMissing) in the translation.

image

This could negatively effect the user experience.

@NilsJacobsen
Copy link
Author

I also sow that the key Recharge Amount is often used but not in the translations. Probably an old key.

image

@bxy4543 bxy4543 requested review from zzjin and c121914yu July 7, 2023 03:13
@zzjin zzjin added this to the v5.0 milestone Jul 7, 2023
@codecov
Copy link

codecov bot commented Jul 7, 2023

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (613ce0f) 72.97% compared to head (34a9d68) 72.97%.
Report is 660 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #3474   +/-   ##
=======================================
  Coverage   72.97%   72.97%           
=======================================
  Files           8        8           
  Lines         618      618           
=======================================
  Hits          451      451           
  Misses        132      132           
  Partials       35       35           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@fanux
Copy link
Member

fanux commented Jul 8, 2023

@c121914yu inlang seems to be a good method for i18n, please follow up on this pull request.

@c121914yu
Copy link
Collaborator

How do I get it started?
Do I need to install other packages? or IDE extension.
Please give a complete example.

Because we are using the i18n ally plugin locally. I'm not sure if inlang can be replaced it.

@NilsJacobsen
Copy link
Author

@c121914yu

How do I get it started?
Do I need to install other packages? or IDE extension.
Please give a complete example.

After merge, you just need to open vscode with the inlang ide-extension installed. It should automatically work.
Usage is documented here -> https://inlang.com/documentation/apps/ide-extension

Because we are using the i18n ally plugin locally. I'm not sure if inlang can be replaced it.

i18n-ally can also be used as a helper with i18n, but inlang is going for the infrastructure approach, which caught me. What does it mean:

In conclusion, inlang can replace it. Especially with the release of opral/monorepo#960 and opral/monorepo#724. But as I said there is no need to decide (no lock-in).

@c121914yu
Copy link
Collaborator

I have added the inlang.config.js file locally and have installed the inlang extension. But didn't seem to see much effect.
I see an sdk in the inlang documentation, do I need to install it?
Or I need to add a configuration in.vscode/settings.json?

@NilsJacobsen
Copy link
Author

I see an sdk in the inlang documentation, do I need to install it?

The SDK is only relevant if you didn't localize yet.

Or I need to add a configuration in.vscode/settings.json?

There shouldn't be anything to change here.

You can test if the config is valid with npx @inlang/cli config validate. -> https://inlang.com/documentation/apps/inlang-cli#config-validate
If that works you should see the inline annotations. Sometimes you need to reload the window. While doing that on the bottom left corner it should say inlang extension activated. After some seconds it should show the annotations and of course, you could use the extract function.

@stale
Copy link

stale bot commented Sep 12, 2023

This issue has been automatically closed because we haven't heard back for more than 60 days, please reopen this issue if necessary.

@NilsJacobsen
Copy link
Author

inlang did a big update which requires an update on this PR.

-> Whats new

Should I change it?

@stale stale bot removed the response-expired label Oct 7, 2023
@c121914yu
Copy link
Collaborator

inlang did a big update which requires an update on this PR.

-> Whats new

Should I change it?

Thank your PR. We will re-evaluate the i18n when we rebuild the architecture in Q4.

Copy link

stale bot commented Dec 6, 2023

This issue has been automatically closed because we haven't heard back for more than 60 days, please reopen this issue if necessary.

@NilsJacobsen
Copy link
Author

NilsJacobsen commented Dec 14, 2023

Hi @c121914yu just wanted to check-in if you talked already about i18n in Q4?
What are/were the topics you want to discuss? Do you have some pain points with it right now?

@stale stale bot removed the response-expired label Dec 14, 2023
Copy link

stale bot commented Feb 13, 2024

This issue has been automatically closed because we haven't heard back for more than 60 days, please reopen this issue if necessary.

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

Successfully merging this pull request may close these issues.

5 participants