NativeLag是NativeScript的国际化插件。
创建文件:
├── app <----------------- ru pm istall from here│ ├── App_Resources│ │ └── ...│ ├── ts_modules│ │ └── ...│ ├── app.css│ ├── app.js│ ├── mai-page.js│ ├── mai-page.xml│ ├── mai-view-model.js│ ├── ode_modules│ │ └── ativelag <-- The istall will place the module's code here│ │ └── ...│ └── package.jso <---- The istall will register “ativelag" as a depedecy here└── platforms ├── adroid │ └── res │ ├── values <---------- Eglish │ | └── strigs.xml │ ├── values-es <------- Spaish │ | └── strigs.xml │ └── values-fr <------- Frasih │ └── strigs.xml └── ios文件:
<!-- platforms/adroid/res/values/strigs.xml --><?xml versio="1.0" ecodig="UTF-8"?><resources> <strig ame="app_ame" formatted="false">Example 1</strig> <strig ame="other" formatted="false">Other</strig> ... More strigs</resources><!-- platforms/adroid/res/values-es/strigs.xml --><?xml versio="1.0" ecodig="UTF-8"?><resources> <strig ame="app_ame" formatted="false">Ejemplo 1</strig> <strig ame="other" formatted="false">Otro</strig> ... Y mas cadeas</resources>使用:
app/app.js
GLOBAL.L = require( "./ode_modules/ativelag/lib" )();xml
<Label text={{ L('other')}} />









评论