diff --git a/.vscode/settings.json b/.vscode/settings.json index ac409863d..24b79e7fc 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -10,5 +10,10 @@ "python.testing.nosetestsEnabled": false, "python.testing.pytestEnabled": true, "cSpell.enableFiletypes": ["!javascript", "!python"], - "python.testing.pytestArgs": ["mealie"] + "python.testing.pytestArgs": ["mealie"], + "i18n-ally.localesPaths": "frontend/src/locales", + "i18n-ally.enabledFrameworks": [ + "vue" + ], + "i18n-ally.keystyle": "nested" } diff --git a/docs/docs/contributors/non-coders.md b/docs/docs/contributors/non-coders.md index cb0480b28..686d0003d 100644 --- a/docs/docs/contributors/non-coders.md +++ b/docs/docs/contributors/non-coders.md @@ -7,6 +7,7 @@ We love your input! We want to make contributing to this project as easy and tra - Submitting a fix - Proposing new features - Becoming a maintainer +- [Help translate to a new language or improve current translations](../translating) [Remember to join the Discord and stay in touch with other developers working on the project](https://discord.gg/R6QDyJgbD2)! diff --git a/docs/docs/contributors/translating.md b/docs/docs/contributors/translating.md new file mode 100644 index 000000000..a53f0d2ad --- /dev/null +++ b/docs/docs/contributors/translating.md @@ -0,0 +1,15 @@ +# Contributing with translations + +Having Mealie in different language could help the adaption of Mealie. Translations can be a great way for non-coders to contribute to Mealie. + +## Is Mealie missing in your language? +If your language is missing, you can add it, by beginning to translate. We use a Vue-i18n in json files. Copy frontend/src/locales/en.json to get started. + +## Improving translations +If your language is missing the translation for some strings, you can help out by adding a translation for that string. If you find a string you think could be improved, please feel free to do so. + +## Tooling +Currently we use Vue-i18n for translations. Translations are stored in json format located in [frontend/src/locales](https://github.com/hay-kot/mealie/tree/master/frontend/src/locales). +If you have experience with a good Translation Management System, please feel free to chime in on the [Discord](https://discord.gg/R6QDyJgbD2), as such a system could be helpful as the projects grow. +Until then, [i18n Ally for VScode](https://marketplace.visualstudio.com/items?itemName=antfu.i18n-ally) is recommended to aid in translating. It also has a nice feature, which shows translations in-place when editing code. +i18n Ally will also show which languages is missing translations. \ No newline at end of file diff --git a/docs/mkdocs.yml b/docs/mkdocs.yml index d7f9170ab..67e4a2666 100644 --- a/docs/mkdocs.yml +++ b/docs/mkdocs.yml @@ -38,6 +38,7 @@ nav: - API Documentation: "api/docs/index.html" - Contributors Guide: - Non-Code: "contributors/non-coders.md" + - Translating: "contributors/translating" - Developers Guide: - Code Contributions: "contributors/developers-guide/code-contributions.md" - Dev Getting Started: "contributors/developers-guide/starting-dev-server.md" diff --git a/frontend/package-lock.json b/frontend/package-lock.json index bfe873610..21680b6fb 100644 --- a/frontend/package-lock.json +++ b/frontend/package-lock.json @@ -1089,6 +1089,16 @@ "postcss": "^7.0.0" } }, + "@intlify/vue-i18n-loader": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/@intlify/vue-i18n-loader/-/vue-i18n-loader-1.0.0.tgz", + "integrity": "sha512-y7LlpKEQ01u7Yq14l4VNlbFYEHMmSEH1QXXASOMWspj9ZcIdCebhhvHCHqk5Oy5Epw3PtoxyRJNpb6Wle5udgA==", + "dev": true, + "requires": { + "js-yaml": "^3.13.1", + "json5": "^2.1.1" + } + }, "@mrmlnc/readdir-enhanced": { "version": "2.2.1", "resolved": "https://registry.npm.taobao.org/@mrmlnc/readdir-enhanced/download/@mrmlnc/readdir-enhanced-2.2.1.tgz", @@ -11038,6 +11048,39 @@ "resolved": "https://registry.npm.taobao.org/vue/download/vue-2.6.12.tgz?cache=0&sync_timestamp=1603223959931&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fvue%2Fdownload%2Fvue-2.6.12.tgz", "integrity": "sha1-9evU+mvShpQD4pqJau1JBEVskSM=" }, + "vue-cli-plugin-i18n": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/vue-cli-plugin-i18n/-/vue-cli-plugin-i18n-1.0.1.tgz", + "integrity": "sha512-sLo6YzudaWgn5dOMvrKixE5bb/onYGxcxm+0YexqoOx0QtR+7hZ/P5WPFBMM9v/2i1ec2YYe2PvKTBel7KE+tA==", + "dev": true, + "requires": { + "debug": "^4.1.0", + "deepmerge": "^4.2.0", + "dotenv": "^8.2.0", + "flat": "^5.0.0", + "rimraf": "^3.0.0", + "vue": "^2.6.11", + "vue-i18n": "^8.17.0", + "vue-i18n-extract": "1.0.2" + }, + "dependencies": { + "deepmerge": { + "version": "4.2.2", + "resolved": "https://registry.npmjs.org/deepmerge/-/deepmerge-4.2.2.tgz", + "integrity": "sha512-FJ3UgI4gIl+PHZm53knsuSFpE+nESMr7M4v9QcgB7S63Kj/6WqMiFQJpBBYz1Pt+66bZpP3Q7Lye0Oo9MPKEdg==", + "dev": true + }, + "rimraf": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-3.0.2.tgz", + "integrity": "sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA==", + "dev": true, + "requires": { + "glob": "^7.1.3" + } + } + } + }, "vue-cli-plugin-vuetify": { "version": "2.0.9", "resolved": "https://registry.npmjs.org/vue-cli-plugin-vuetify/-/vue-cli-plugin-vuetify-2.0.9.tgz", @@ -11107,6 +11150,16 @@ "integrity": "sha1-UylVzB6yCKPZkLOp+acFdGV+CPI=", "dev": true }, + "vue-html-to-paper": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/vue-html-to-paper/-/vue-html-to-paper-1.3.1.tgz", + "integrity": "sha512-5IdAPUgStfpVHfcG6nXD0FbUB1onWpvwVD+OZ00jJpy3qaRPkaGD7fFIvYgBB9YPkr0VK065LayEvmGmkkfhaQ==" + }, + "vue-i18n": { + "version": "8.22.3", + "resolved": "https://registry.npmjs.org/vue-i18n/-/vue-i18n-8.22.3.tgz", + "integrity": "sha512-Vhyx7sZEmmW/aZLkzSlXei08Rv3hTondx4J9wbOjnThocTIK1QiXV6QRdT4BTnhT24JixDSf6kGkxqCXSaJ3Jw==" + }, "vue-loader": { "version": "15.9.5", "resolved": "https://registry.npm.taobao.org/vue-loader/download/vue-loader-15.9.5.tgz?cache=0&sync_timestamp=1605670886675&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fvue-loader%2Fdownload%2Fvue-loader-15.9.5.tgz", diff --git a/frontend/package.json b/frontend/package.json index fa0a251ca..f69ea8ccf 100644 --- a/frontend/package.json +++ b/frontend/package.json @@ -5,7 +5,8 @@ "scripts": { "serve": "vue-cli-service serve", "build": "vue-cli-service build", - "lint": "vue-cli-service lint" + "lint": "vue-cli-service lint", + "i18n:report": "vue-cli-service i18n:report --src './src/**/*.?(js|vue)' --locales './src/locales/**/*.json'" }, "dependencies": { "axios": "^0.21.1", @@ -14,12 +15,14 @@ "qs": "^6.9.4", "v-jsoneditor": "^1.4.2", "vue": "^2.6.11", + "vue-i18n": "^8.22.3", "vue-router": "^3.4.9", "vuetify": "^2.4.2", "vuex": "^3.6.0", "vuex-persistedstate": "^4.0.0-beta.2" }, "devDependencies": { + "@intlify/vue-i18n-loader": "^1.0.0", "@vue/cli-plugin-babel": "~4.5.0", "@vue/cli-plugin-eslint": "~4.5.0", "@vue/cli-service": "~4.5.0", @@ -28,7 +31,8 @@ "eslint-plugin-vue": "^6.2.2", "sass": "^1.32.0", "sass-loader": "^8.0.0", - "vue-cli-plugin-vuetify": "^2.0.9", + "vue-cli-plugin-i18n": "~1.0.1", + "vue-cli-plugin-vuetify": "^2.0.8", "vue-template-compiler": "^2.6.11", "vuetify-loader": "^1.3.0" }, diff --git a/frontend/src/components/MealPlan/MealPlanEditor.vue b/frontend/src/components/MealPlan/MealPlanEditor.vue index e1164fce2..40df06270 100644 --- a/frontend/src/components/MealPlan/MealPlanEditor.vue +++ b/frontend/src/components/MealPlan/MealPlanEditor.vue @@ -1,12 +1,13 @@