Skip to content

Commit

Permalink
chore: use smaller markty-toml lib (evcc-io#5589)
Browse files Browse the repository at this point in the history
  • Loading branch information
naltatis authored Dec 27, 2022
1 parent 4291eaa commit a834208
Show file tree
Hide file tree
Showing 6 changed files with 147 additions and 134 deletions.
4 changes: 2 additions & 2 deletions assets/js/i18n.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import toml from "toml";
import parseToml from "markty-toml";
import { nextTick } from "vue";
import { createI18n } from "vue-i18n";
import en from "../../i18n/en.toml";
Expand Down Expand Up @@ -77,7 +77,7 @@ export function setI18nLanguage(i18n, locale) {
async function loadLocaleMessages(i18n, locale) {
try {
const response = await i18nApi.get(`${locale}.toml`, { params: { v: window.evcc?.version } });
const messages = toml.parse(response.data);
const messages = parseToml(response.data);
i18n.setLocaleMessage(locale, messages);
} catch (e) {
console.error(`unable to load translation for [${locale}]`, e);
Expand Down
116 changes: 116 additions & 0 deletions dist/assets/index.16c34ec8.js

Large diffs are not rendered by default.

119 changes: 0 additions & 119 deletions dist/assets/index.f41944cd.js

This file was deleted.

2 changes: 1 addition & 1 deletion dist/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
<meta name="theme-color" content="#020318" />

<title>evcc</title>
<script type="module" crossorigin src="./assets/index.f41944cd.js"></script>
<script type="module" crossorigin src="./assets/index.16c34ec8.js"></script>
<link rel="stylesheet" href="./assets/index.b7c1c9f8.css">
</head>

Expand Down
38 changes: 27 additions & 11 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,11 @@
"eslint-plugin-promise": "^6.0.0",
"eslint-plugin-vue": "^9.3.0",
"histoire": "^0.11.6",
"markty-toml": "^0.1.1",
"prettier": "^2.5.1",
"prettier-plugin-toml": "^0.3.1",
"rollup-plugin-visualizer": "^5.8.3",
"smoothscroll-polyfill": "^0.4.4",
"toml": "^3.0.0",
"vite": "^3.2.5",
"vite-plugin-toml": "^0.5.0",
"vue": "^3.2.29",
Expand Down

0 comments on commit a834208

Please sign in to comment.