The translation files are located in litemall-admin/src/locales.
The translation keys follow the convention {page}.{context}.{description} (e.g. goods_list.table.id for the column '商品ID', in the table of the goods/list page).
Many translations are redundant, but it might be relevant to keep them, because the translation might differ in some languages w.r.t. the context. Also, it is easy to merge them, but difficult to undo the merges.
Locale changer component
The user is able to change the current language thanks to the LocaleChanger component, added on the top-right corner of the login page.
The component source is located in litemall-admin/src/components/LocaleChanger/index.vue, and can be reused anywhere.
This pull request adds the ability to translate the admin interface using
vue-i18n
, and provides translations in english and chinese.Changes in the code
Static text elements have been replaced by translatable keys as in the following examples:
Example 1:
replaced by:
Example 2:
replaced by:
Translation files
The translation files are located in
litemall-admin/src/locales
. The translation keys follow the convention{page}.{context}.{description}
(e.g.goods_list.table.id
for the column '商品ID', in the table of thegoods/list
page). Many translations are redundant, but it might be relevant to keep them, because the translation might differ in some languages w.r.t. the context. Also, it is easy to merge them, but difficult to undo the merges.Locale changer component
The user is able to change the current language thanks to the
LocaleChanger
component, added on the top-right corner of the login page. The component source is located inlitemall-admin/src/components/LocaleChanger/index.vue
, and can be reused anywhere.Screenshots
Locale changer:![litemall_login](https://github.com/linlinjava/litemall/assets/645647/8a475f26-60e8-4d44-b044-838a9b1397fd)