wp1 icon indicating copy to clipboard operation
wp1 copied to clipboard

Added multilingual support with Vue I18n #753

Open khushi-2503 opened this issue 1 year ago • 10 comments

Changes Made 1.Installed vue-i18n for internationalization

2.Added locale JSON files (en.json, sp.json, fr.json, ar.json)

3.Configured Vue I18n in main.js with locale persistence

4.Implemented dynamic language switching in App.vue

5.Updated UI with a language selector dropdown

6.Stored selected language in localStorage for persistence 7.Refactored text strings to use $t() for translations Enhancements: Users can now switch languages seamlessly, and their preferences persist across sessions.

khushi-2503 avatar Mar 27 '25 16:03 khushi-2503

I have made the changes in App.vue

khushi-2503 avatar Mar 30 '25 06:03 khushi-2503

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 91.57%. Comparing base (605d590) to head (202b389).

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #821   +/-   ##
=======================================
  Coverage   91.57%   91.57%           
=======================================
  Files          66       66           
  Lines        3597     3597           
=======================================
  Hits         3294     3294           
  Misses        303      303           

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

:rocket: New features to boost your workflow:
  • :snowflake: Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • :package: JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

codecov[bot] avatar Mar 30 '25 17:03 codecov[bot]

@audiodude could u pls point out what is possible reason for the failing check

khushi-2503 avatar Mar 31 '25 02:03 khushi-2503

@audiodude could u pls point out what is possible reason for the failing check

Error message is here: https://github.com/openzim/wp1/actions/runs/14153402449/job/39660150956

Looks like you're trying to import Vue and initialize the app, but the proper existing code for that happens at the bottom of the main.js file. Please remove the added initialization code and keep only the parts needed for i18n.

audiodude avatar Mar 31 '25 03:03 audiodude

Thank u @audiodude for pointing out the mistakes i have corrected them

khushi-2503 avatar Mar 31 '25 06:03 khushi-2503

The issue is arising from package.json file . It does not have vue-i18n package . i will make the changes

khushi-2503 avatar Mar 31 '25 16:03 khushi-2503

I have added vue-i18n package in the dependencies .

khushi-2503 avatar Apr 01 '25 03:04 khushi-2503

It looks like you checked in a node_modules directory. Please rebase your changes to remove that commit. Do not commit another commit that simply deletes it, or the files will be in the repo hashes forever (and inflate the size of the repo).

audiodude avatar Apr 01 '25 04:04 audiodude

It looks like you checked in a node_modules directory. Please rebase your changes to remove that commit. Do not commit another commit that simply deletes it, or the files will be in the repo hashes forever (and inflate the size of the repo).

Once the files are committed, the repo size increases even when you delete them in a subsequent commit. That's why I said you should use rebase to remove them, not just commit a new commit that simply deletes them.

See this SO answer: https://stackoverflow.com/a/70355815/41060

You will have to rewrite git history somehow, whether through rebase or git filter-repo.

audiodude avatar Apr 02 '25 00:04 audiodude

Hi @khushi-2503

If you're still interested in contributing this change, let me know, and perhaps I can help you fix it up a bit. If not that's fine, let me know either way and we can close. Thanks!

audiodude avatar Sep 23 '25 20:09 audiodude