diff --git a/package.json b/package.json index 2f310de7..be91a733 100644 --- a/package.json +++ b/package.json @@ -18,7 +18,7 @@ "unlink-dist": "cd dist && npm unlink && rm package*", "watch": "NODE_ENV=development rollup --watch -c", "i18n-scan": "i18next-scanner --config i18next-scanner.config.js src/**/*.{js,jsx}", - "i18n-conv-json": "i18next-conv -l en -s ./src/lib/translations/en/translations.json -t ./src/lib/translations/en/translations.po", + "i18n-conv-json": "i18next-conv -l en -s ./src/lib/translations/en/translations.json -t ./src/lib/translations/translations.pot", "test": "react-scripts test", "eject": "react-scripts eject", "lint": "eslint src/**/*.js", @@ -40,8 +40,7 @@ "semantic-ui-css": "^2.4.1", "@babel/runtime": "^7.9.0", "i18next": "^20.3.1", - "i18next-browser-languagedetector": "^6.1.1", - "react-i18next": "^11.11.0" + "i18next-browser-languagedetector": "^6.1.1" }, "devDependencies": { "@babel/cli": "^7.5.5", diff --git a/src/lib/i18next.js b/src/lib/i18next.js index 5e6cd8b2..fcf191a9 100644 --- a/src/lib/i18next.js +++ b/src/lib/i18next.js @@ -4,25 +4,17 @@ // React-Invenio-Deposit is free software; you can redistribute it and/or modify it // under the terms of the MIT License; see LICENSE file for more details. -// I18next dependencies -// npm install react-i18next i18next i18next-browser-languagedetector --save - import i18next from 'i18next'; import TRANSLATIONS_DE from './translations/de/translations.json'; import TRANSLATIONS_EN from './translations/en/translations.json'; +import TRANSLATIONS_TR from './translations/tr/translations.json'; import LanguageDetector from 'i18next-browser-languagedetector'; -import { initReactI18next } from 'react-i18next'; i18next // detect user language - // learn more: https://github.com/i18next/i18next-browser-languageDetector .use(LanguageDetector) - // pass the i18n instance to react-i18next. - .use(initReactI18next) - // init i18next - // for all options read: https://www.i18next.com/overview/configuration-options .init({ fallbackLng: 'en', debug: true, @@ -33,6 +25,9 @@ i18next de: { translation: TRANSLATIONS_DE, }, + tr: { + translation: TRANSLATIONS_TR, + }, }, // specify language detection order detection: { diff --git a/src/lib/translations/tr/translations.json b/src/lib/translations/tr/translations.json new file mode 100644 index 00000000..9da40611 --- /dev/null +++ b/src/lib/translations/tr/translations.json @@ -0,0 +1,5 @@ +{ + "New version": "New version", + "New upload": "New upload", + "Edit upload": "Edit upload" +} diff --git a/src/lib/translations/en/translations.po b/src/lib/translations/translations.pot similarity index 78% rename from src/lib/translations/en/translations.po rename to src/lib/translations/translations.pot index 980168a5..7ee63721 100644 --- a/src/lib/translations/en/translations.po +++ b/src/lib/translations/translations.pot @@ -5,8 +5,8 @@ msgstr "" "Content-Type: text/plain; charset=utf-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=(n != 1)\n" -"POT-Creation-Date: 2021-06-25T10:09:29.684Z\n" -"PO-Revision-Date: 2021-06-25T10:09:29.684Z\n" +"POT-Creation-Date: 2021-06-28T11:40:44.007Z\n" +"PO-Revision-Date: 2021-06-28T11:40:44.007Z\n" "Language: en\n" msgid "New version"