PWA I18N Webpack基于Vaadin的lit-html多语言示例

基于 Vaadin 教程的示例挺实用的,尤其适合你要做多语言支持的 Web App。用的是lit-html,模板清爽、逻辑也直观。资源管理用的是gulp流程,从添加语言、自动生成翻译资源,到合并翻译和打包,整套下来挺顺滑的,适合边开发边调试的场景。

默认就支持了deesfrjazh-Hans几个语言,你可以用gulp locales --targets="..."快速加别的语言,跑下gulp任务就能生成对应的xliff文件。翻译完再npm run prod一键打包,部署到dist目录,用python -m SimpleHTTPServer直接起服务就行。

整套下来不用复杂配置,也没强依赖大框架,蛮适合自己动手拆着学。你如果是刚上手i18n或者想快速试下lit-html多语言支持,这套代码还挺值得一看的。

zip
pwa-i18n-webpack-master.zip 预估大小:68个文件
folder
pwa-i18n-webpack-master 文件夹
folder
preprocess 文件夹
file
index.html 1KB
file
manifest.webmanifest 434B
folder
redux 文件夹
file
store.js 535B
file
reducer.js 2KB
file
actions.js 669B
file
styles.css 790B
folder
views 文件夹
file
nothing-to-do.json 61B
file
not-found-view.js 735B
file
base-view.js 174B
folder
locales 文件夹
file
chart-labels.ja.json 105B
file
stats-view.ja.json 49B
file
todo-view.ja.json 426B
file
nothing-to-do.ja.json 96B
file
not-found-view.ja.json 83B
file
chart-labels.json 81B
file
todo-view.json 352B
file
not-found-view.json 53B
file
stats-view.json 31B
file
stats-view.js 3KB
file
todo-view.js 5KB
folder
locales 文件夹
file
bundle.ja.json 963B
folder
img 文件夹
folder
icons 文件夹
file
icon-144x144.png 4KB
file
favicon.png 2KB
file
icon-512x512.png 14KB
file
icon-192x192.png 5KB
file
sw.js 97B
file
bundle.json 987B
file
index.js 983B
file
webpack.config.js 2KB
folder
src 文件夹
file
index.html 1KB
file
manifest.webmanifest 434B
folder
redux 文件夹
file
store.js 535B
file
reducer.js 2KB
file
actions.js 669B
file
styles.css 790B
folder
views 文件夹
file
nothing-to-do.json 61B
file
not-found-view.js 535B
file
base-view.js 174B
folder
locales 文件夹
file
chart-labels.ja.json 105B
file
stats-view.ja.json 49B
file
todo-view.ja.json 426B
file
nothing-to-do.ja.json 96B
file
not-found-view.ja.json 83B
file
chart-labels.json 81B
file
todo-view.json 352B
file
not-found-view.json 53B
file
stats-view.json 31B
file
stats-view.js 2KB
file
todo-view.js 5KB
folder
locales 文件夹
file
bundle.ja.json 963B
folder
xliff 文件夹
file
bundle.ja.xlf 3KB
folder
img 文件夹
folder
icons 文件夹
file
icon-144x144.png 4KB
file
favicon.png 2KB
file
icon-512x512.png 14KB
file
icon-192x192.png 5KB
file
sw.js 97B
file
bundle.json 987B
file
index.js 983B
folder
.vscode 文件夹
file
tutorial.code-snippets 2KB
file
gulpfile.js 40KB
folder
build-utils 文件夹
folder
presets 文件夹
file
webpack.serviceworker.js 185B
file
webpack.production.js 269B
file
loadPresets.js 388B
file
webpack.development.js 347B
file
.gitignore 32B
file
readme.md 1KB
file
package-lock.json 378KB
file
package.json 3KB
...
zip 文件大小:172.69KB