Updated readme.
This commit is contained in:
parent
8a3e8044d3
commit
10e6e4c5e3
|
@ -29,3 +29,12 @@ cp path_to_loki_binaries/loki-wallet-rpc bin/
|
|||
npm install
|
||||
quasar build -m electron -t mat
|
||||
```
|
||||
|
||||
### Adding language support
|
||||
|
||||
Adding a new language is fairly simple.
|
||||
|
||||
1. Duplicate the language file `src/i18n/en-us.js` and rename it to the relevant language code.
|
||||
2. Translate all the strings in that duplicated file. Take note that capitalization matters.
|
||||
3. Add the language to the `languages` array in `src/i18n/index.js`. The `flag` property is the [ISO 3166-1-alpha-2 code](https://www.iso.org/obp/ui/#search/code/) of a country.
|
||||
4. Submit a PR with your changes.
|
||||
|
|
|
@ -18,18 +18,20 @@
|
|||
</template>
|
||||
|
||||
<script>
|
||||
import { languages } from "src/i18n"
|
||||
|
||||
export default {
|
||||
name: "LanguageSelect",
|
||||
data () {
|
||||
return {
|
||||
options: [
|
||||
{ label: "English", value: "en-us", flag: "us" },
|
||||
]
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
lang () {
|
||||
return this.$i18n.locale
|
||||
},
|
||||
options () {
|
||||
return languages.map(lang => ({
|
||||
label: lang.name,
|
||||
value: lang.code,
|
||||
flag: lang.flag
|
||||
}))
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
|
|
|
@ -1,7 +1,13 @@
|
|||
// LOKI: DO NOT MODIFY THIS FILE
|
||||
// LANGUAGE FILES CAN BE DYNAMICALLY LOADED
|
||||
import enUS from "./en-us"
|
||||
|
||||
// ADD LANGUAGES HERE
|
||||
const languages = [
|
||||
{ name: "English", code: "en-us", flag: "us" }
|
||||
]
|
||||
|
||||
export { languages }
|
||||
|
||||
// DO NOT MODIFY THIS EXPORT, LANGUAGE FILES CAN BE DYNAMICALLY LOADED
|
||||
export default {
|
||||
"en-us": enUS
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue