You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@apisix.apache.org by GitBox <gi...@apache.org> on 2020/08/13 09:50:31 UTC

[GitHub] [apisix-dashboard] liuxiran commented on a change in pull request #373: docs: create I18N_USER_GUIDE.md

liuxiran commented on a change in pull request #373:
URL: https://github.com/apache/apisix-dashboard/pull/373#discussion_r469833632



##########
File path: I18N_USER_GUIDE.md
##########
@@ -0,0 +1,147 @@
+<!--
+#
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements.  See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License.  You may obtain a copy of the License at
+#
+#     http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+-->
+
+# Apache APISIX Dashboard I18N User Guide
+
+The Apache APISIX Dashboard uses [@umijs/plugin-locale](https://umijs.org/plugins/plugin-locale) to solve the i18n issues, in order to make the i18n more clear and reasonable, we would recommend to obey the following rules
+
+## Location of locale configuration:
+
+- Please put **the global locales** under `src/locales`.
+- Please put **each page's locale file** under `src/pages/$PAGE/locales` folder.
+- Please put **the Component's locale file** under `src/components/$COMPONENT/locales` folder, and we **MUST** import them manually
+
+## How to name the key for each locale filed:
+
+the key can be like this : [basicModule].[moduleName].[elementName].[...desc]
+
+- what's the first tow levels? e.g: `app.pwa`, `page.consumer`, `component.actionBar`
+
+- The subkeys are divided into $element + $description style e.g: `app.pwa.message.offline`, `component.actionBar.button.nextStep`
+
+  - If the the text is the part of a element, we can use [elementNameProps] e.g: `page.consumer.proTableColumns.username`.
+  - If there are two or more same level part locales of a element, we can add number suffix e.g: `page.route.form.itemRulesExtraMessage1.path`, `page.route.form.itemRulesExtraMessage2.path`.
+
+- common texts, we should not repeat in other part, and the common locale key omit [elementName] would be better.

Review comment:
       sorry to do a force-push, I will pay attention next time。
   This paragraph needs check, and others fixed refer to your suggestions。
   @juzhiyuan 




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org