Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

https://github.com/uiwebkit/localize-vue-3x

Uni Localization example for Vue.js 3.x
https://github.com/uiwebkit/localize-vue-3x

custom-elements html localization localize translate translation uiwebkit uni-localization vue vue-cli vue3 vuejs web web-components widget

Last synced: about 1 month ago
JSON representation

Uni Localization example for Vue.js 3.x

Lists

README

        

# Uni Localization example for Vue.js 3.x

Check out demo [here](https://uiwebkit.github.io/localize-vue-3x/)

Check out our docs [here](https://uiwebkit.com/wgt/loc/2)

### Add to vue.config.js

```js
module.exports = {
...,
chainWebpack: (config) => {
config.module
.rule("vue")
.use("vue-loader")
.tap((options) => ({
...options,
compilerOptions: {
...options.compilerOptions,
// treat any tag that starts with uni- as custom elements
isCustomElement: (tag) => tag.startsWith("uni-"),
},
}));
},
...
};
```

### Add to index.html

```html

```

#### Place Uni Language Menu into the header of your web app. Specify the path to the language list JSON file (ex. lang-menu.json) or backend API endpoint

```html

```

#### Wrap your content with Uni Translate globally (for more convenience)

```html

```

#### or wrap your text content with Uni Translate locally (for better performance)

```html
localized content
```

#### localize partially

```html
text and (( partially localized ))
```

#### localize attributes

```html

link

```

#### open and modify ./public/lang-menu.json and translation files into ./public/i18n/ folder