From 35f6592f7633b41cf8725a2a9ab6f1227fd63047 Mon Sep 17 00:00:00 2001 From: Jaifroid Date: Sun, 14 Jul 2024 13:57:38 +0100 Subject: [PATCH] Add i189 for Chromium store entries #1118 (#1271) --- _locales/en/messages.json | 11 +++++++++++ _locales/es/messages.json | 11 +++++++++++ _locales/fr/messages.json | 11 +++++++++++ manifest.json | 5 +++-- rollup.config.js | 2 +- scripts/create_all_packages.sh | 2 +- scripts/package_chrome_extension.sh | 4 ++-- scripts/package_firefox_extension.sh | 4 ++-- 8 files changed, 42 insertions(+), 8 deletions(-) create mode 100644 _locales/en/messages.json create mode 100644 _locales/es/messages.json create mode 100644 _locales/fr/messages.json diff --git a/_locales/en/messages.json b/_locales/en/messages.json new file mode 100644 index 000000000..e1b97841f --- /dev/null +++ b/_locales/en/messages.json @@ -0,0 +1,11 @@ +{ + "extensionName": { + "message": "Kiwix JS Browser Extension", + "description": "Name of the extension." + }, + + "extensionDescription": { + "message": "Kiwix is an offline reader for content from Wikipedia, TED Talks, Stackexchange, and many other sources.", + "description": "Description of the extension." + } +} diff --git a/_locales/es/messages.json b/_locales/es/messages.json new file mode 100644 index 000000000..2bf547a6d --- /dev/null +++ b/_locales/es/messages.json @@ -0,0 +1,11 @@ +{ + "extensionName": { + "message": "Extensión de navegador Kiwix JS", + "description": "Nombre de la extensión." + }, + + "extensionDescription": { + "message": "Kiwix es un lector sin conexión para contenido de Wikipedia, TED Talks, Stackexchange y muchas otras fuentes.", + "description": "Descripción de la extensión." + } +} diff --git a/_locales/fr/messages.json b/_locales/fr/messages.json new file mode 100644 index 000000000..333568e44 --- /dev/null +++ b/_locales/fr/messages.json @@ -0,0 +1,11 @@ +{ + "extensionName": { + "message": "Extension de navigateur Kiwix JS", + "description": "Nom de l'extension." + }, + + "extensionDescription": { + "message": "Kiwix est un lecteur hors ligne pour le contenu de Wikipédia, TED Talks, Stackexchange et de nombreuses autres sources.", + "description": "Déscription de l'extension." + } +} diff --git a/manifest.json b/manifest.json index fd8b8732e..10f5bcf2e 100644 --- a/manifest.json +++ b/manifest.json @@ -1,10 +1,10 @@ { "manifest_version": 3, - "name": "Kiwix JS Browser Extension", + "name": "__MSG_extensionName__", "short_name": "Kiwix JS", "version": "4.0.1", - "description": "Kiwix is an offline reader for content from Wikipedia, TED Talks, Stackexchange, and many other sources.", + "description": "__MSG_extensionDescription__", "icons": { "16": "www/img/icons/kiwix-16.png", @@ -42,6 +42,7 @@ "matches": ["https://*.kiwix.org/*", "https://kiwix.github.io/*"] }], + "default_locale": "en", "author": "Kiwix", "homepage_url": "https://www.kiwix.org", "offline_enabled": true diff --git a/rollup.config.js b/rollup.config.js index 2db22e889..afc816d64 100644 --- a/rollup.config.js +++ b/rollup.config.js @@ -47,7 +47,7 @@ const config = { dest: 'dist/www/js' }, { src: ['node_modules/bootstrap/dist/css/bootstrap.min.*'], dest: 'dist/www/css' }, - { src: ['i18n/*'], dest: 'dist/i18n' }, + { src: ['i18n', '_locales'], dest: 'dist' }, { src: ['archives', 'backgroundscript.js', 'index.html', 'manifest.json', 'manifest.fx.v3.json', 'manifest.v2.json', 'manifest.webapp', 'manifest.webmanifest', 'package.json', 'LICENSE-GPLv3.txt', 'CHANGELOG.md', 'README.md', '*.pfx', '*.cjs'], dest: 'dist' } ], flatten: true diff --git a/scripts/create_all_packages.sh b/scripts/create_all_packages.sh index ed35c3943..a9026c546 100755 --- a/scripts/create_all_packages.sh +++ b/scripts/create_all_packages.sh @@ -59,7 +59,7 @@ fi # Copy only the necessary files in a temporary directory mkdir -p tmp rm -rf tmp/* -cp -r www i18n manifest.json manifest.webapp LICENSE-GPLv3.txt service-worker.js README.md tmp/ +cp -r www i18n _locales manifest.json manifest.webapp LICENSE-GPLv3.txt service-worker.js README.md tmp/ # Remove unwanted files (this line should not be necessary if building from dist/) rm -f tmp/www/js/lib/libzim-*dev.* diff --git a/scripts/package_chrome_extension.sh b/scripts/package_chrome_extension.sh index d954f9d50..6a4e693af 100755 --- a/scripts/package_chrome_extension.sh +++ b/scripts/package_chrome_extension.sh @@ -21,12 +21,12 @@ if [ $MV -eq 2 ]; then echo "Packing MV2 extension" pwd & ls -l cat manifest.json - zip -r ../build/kiwix-chrome-unsigned-extension-$VERSION.zip www i18n backgroundscript.js manifest.json LICENSE-GPLv3.txt service-worker.js README.md + zip -r ../build/kiwix-chrome-unsigned-extension-$VERSION.zip www _locales i18n backgroundscript.js manifest.json LICENSE-GPLv3.txt service-worker.js README.md else echo "Packing MV3 extension" pwd & ls -l cat manifest.json - zip -r ../build/kiwix-chrome-unsigned-extension-$VERSION.zip www i18n manifest.json LICENSE-GPLv3.txt service-worker.js README.md + zip -r ../build/kiwix-chrome-unsigned-extension-$VERSION.zip www _locales i18n manifest.json LICENSE-GPLv3.txt service-worker.js README.md fi cd .. ls -l build/kiwix-chrome-unsigned-extension-$VERSION.zip diff --git a/scripts/package_firefox_extension.sh b/scripts/package_firefox_extension.sh index 08e89a097..eff47ea67 100755 --- a/scripts/package_firefox_extension.sh +++ b/scripts/package_firefox_extension.sh @@ -27,7 +27,7 @@ fi cd tmp if [ "${TAG}zz" == "zz" ]; then echo "Packaging unsigned Firefox extension, version $VERSION" - zip -r ../build/kiwix-firefox-unsigned-extension-$VERSION.zip www i18n backgroundscript.js manifest.json LICENSE-GPLv3.txt service-worker.js README.md + zip -r ../build/kiwix-firefox-unsigned-extension-$VERSION.zip www _locales i18n backgroundscript.js manifest.json LICENSE-GPLv3.txt service-worker.js README.md if [ "${DRYRUN}zz" == "zz" ]; then # Sign the extension with the Mozilla API through web-ext, if we're not packaging a public version @@ -73,6 +73,6 @@ else sed -i -e "s/kiwix-html5-unlisted@kiwix.org/kiwix-html5-listed@kiwix.org/" manifest.json echo "Packaging unsigned 'listed' Firefox extension, version $VERSION" - zip -r ../build/kiwix-firefox-unsigned-listed-extension-$VERSION.zip www i18n backgroundscript.js manifest.json LICENSE-GPLv3.txt service-worker.js README.md + zip -r ../build/kiwix-firefox-unsigned-listed-extension-$VERSION.zip www _locales i18n backgroundscript.js manifest.json LICENSE-GPLv3.txt service-worker.js README.md echo "*** This unsigned extension must be manually uploaded to Mozilla to be signed and distributed from their store ***" fi