mirror of
https://github.com/betaflight/betaflight-configurator.git
synced 2025-07-22 15:55:33 +03:00
chore: ESM for localization
This commit is contained in:
parent
4fa1f6a4c0
commit
73172bdb04
10 changed files with 90 additions and 15 deletions
|
@ -1,3 +1,9 @@
|
|||
// This modules is imported and has side effect of attaching the
|
||||
// `i18n` helper to window and setting up `i18next`
|
||||
// in the future it should be pure. This means it should
|
||||
// explicitly export things used by other parts of the app.
|
||||
import '../js/localization.js';
|
||||
import i18next from 'i18next';
|
||||
import Vue from "vue";
|
||||
import vueI18n from "./vueI18n.js";
|
||||
import BatteryLegend from "./quad-status/BatteryLegend.vue";
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
import Vue from "vue";
|
||||
import VueI18Next from "@panter/vue-i18next";
|
||||
import i18next from 'i18next';
|
||||
|
||||
Vue.use(VueI18Next);
|
||||
|
||||
|
|
|
@ -1,10 +1,12 @@
|
|||
'use strict';
|
||||
import i18next from 'i18next';
|
||||
import i18nextXHRBackend from 'i18next-xhr-backend';
|
||||
|
||||
const i18n = {};
|
||||
/*
|
||||
* Wrapper around the i18n system
|
||||
*/
|
||||
window.i18n = i18n;
|
||||
|
||||
window.i18n = {};
|
||||
|
||||
const languagesAvailables = ['ca', 'de', 'en', 'es', 'eu', 'fr', 'gl', 'hr', 'hu', 'id', 'it', 'ja', 'ko', 'lv', 'nl', 'pt', 'pt_BR', 'pl', 'ru', 'sv', 'zh_CN', 'zh_TW'];
|
||||
|
||||
|
@ -242,3 +244,5 @@ i18n.addResources = function(bundle) {
|
|||
const ns = takeFirst(i18next.options.defaultNS);
|
||||
i18next.addResourceBundle(lang, ns, bundle, true, true);
|
||||
};
|
||||
|
||||
export { i18n };
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
'use strict';
|
||||
import { i18n } from "./localization.js";
|
||||
|
||||
const REQUIRED_WEBVIEW_VERSION = 72;
|
||||
const WEBVIEW = {
|
||||
|
|
|
@ -49,8 +49,6 @@
|
|||
<!-- CORDOVA_INCLUDE js/cordova_chromeapi.js -->
|
||||
<!-- CORDOVA_INCLUDE js/cordova_startup.js -->
|
||||
<script type="text/javascript" src="./node_modules/lru_map/lru.js"></script>
|
||||
<script type="text/javascript" src="./node_modules/i18next/i18next.min.js"></script>
|
||||
<script type="text/javascript" src="./node_modules/i18next-xhr-backend/i18nextXHRBackend.min.js"></script>
|
||||
<script type="text/javascript" src="./node_modules/marked/marked.min.js"></script>
|
||||
<script type="text/javascript" src="./node_modules/universal-ga/lib/analytics.min.js"></script>
|
||||
<script type="text/javascript" src="./node_modules/short-unique-id/dist/short-unique-id.min.js"></script>
|
||||
|
@ -93,7 +91,6 @@
|
|||
<script type="text/javascript" src="./js/peripherals.js"></script>
|
||||
<script type="text/javascript" src="./js/protocols/stm32.js"></script>
|
||||
<script type="text/javascript" src="./js/protocols/stm32usbdfu.js"></script>
|
||||
<script type="text/javascript" src="./js/localization.js"></script>
|
||||
<script type="text/javascript" src="./js/boards.js"></script>
|
||||
<script type="text/javascript" src="./js/RateCurve.js"></script>
|
||||
<script type="text/javascript" src="./js/Features.js"></script>
|
||||
|
|
|
@ -39,10 +39,7 @@
|
|||
</div>
|
||||
</div>
|
||||
<script type="text/javascript" src="./node_modules/jquery/dist/jquery.min.js"></script>
|
||||
<script type="text/javascript" src="./node_modules/i18next/i18next.min.js"></script>
|
||||
<script type="text/javascript" src="./node_modules/i18next-xhr-backend/i18nextXHRBackend.min.js"></script>
|
||||
<script type="text/javascript" src="./js/localization.js"></script>
|
||||
<script type="text/javascript" src="cordova.js"></script>
|
||||
<script type="text/javascript" src="./js/main_cordova.js"></script>
|
||||
<script type="module" src="./js/main_cordova.js"></script>
|
||||
</body>
|
||||
</html>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue