未验证 提交 047e8908 编写于 作者: S Shu Muto 提交者: GitHub

Code block highlighting on docs/developer (#5806)

* Update internationalization.md

* Update internationalization.md

* Update internationalization.md

* Update getting-started.md

* Update code-conventions.md
上级 9ec95004
...@@ -21,13 +21,13 @@ An overview of the features provided by the dashboard can be found [here](https: ...@@ -21,13 +21,13 @@ An overview of the features provided by the dashboard can be found [here](https:
The code style check suite includes format checks can be executed with: The code style check suite includes format checks can be executed with:
``` ```shell
npm run check npm run check
``` ```
The code formatting can be executed with: The code formatting can be executed with:
``` ```shell
npm run fix npm run fix
``` ```
......
...@@ -16,13 +16,13 @@ Make sure the following software is installed and added to the `$PATH` variable: ...@@ -16,13 +16,13 @@ Make sure the following software is installed and added to the `$PATH` variable:
Clone the repository into `$GOPATH/src/github.com/kubernetes/dashboard` and install the dependencies: Clone the repository into `$GOPATH/src/github.com/kubernetes/dashboard` and install the dependencies:
``` ```shell
npm ci npm ci
``` ```
If you are running commands with root privileges set `--unsafe-perm flag`: If you are running commands with root privileges set `--unsafe-perm flag`:
``` ```shell
npm ci --unsafe-perm npm ci --unsafe-perm
``` ```
...@@ -30,7 +30,7 @@ npm ci --unsafe-perm ...@@ -30,7 +30,7 @@ npm ci --unsafe-perm
To make Dashboard work you need to have cluster running. If you would like to use local cluster we recommend [kubeadm](https://kubernetes.io/docs/setup/independent/create-cluster-kubeadm/), [minikube](https://kubernetes.io/docs/getting-started-guides/minikube/) or [kubeadm-dind-cluster](https://github.com/Mirantis/kubeadm-dind-cluster). The most convenient way is to make it work is to create a proxy. Run the following command: To make Dashboard work you need to have cluster running. If you would like to use local cluster we recommend [kubeadm](https://kubernetes.io/docs/setup/independent/create-cluster-kubeadm/), [minikube](https://kubernetes.io/docs/getting-started-guides/minikube/) or [kubeadm-dind-cluster](https://github.com/Mirantis/kubeadm-dind-cluster). The most convenient way is to make it work is to create a proxy. Run the following command:
``` ```shell
kubectl proxy kubectl proxy
``` ```
...@@ -40,13 +40,13 @@ kubectl will handle authentication with Kubernetes and create an API proxy with ...@@ -40,13 +40,13 @@ kubectl will handle authentication with Kubernetes and create an API proxy with
Quick updated version: Quick updated version:
``` ```shell
npm start npm start
``` ```
Another way to connect to real cluster while developing dashboard is to specify options for `npm` like following: Another way to connect to real cluster while developing dashboard is to specify options for `npm` like following:
``` ```shell
npm run start:https --kubernetes-dashboard:kubeconfig=<path to your kubeconfig> npm run start:https --kubernetes-dashboard:kubeconfig=<path to your kubeconfig>
``` ```
...@@ -70,7 +70,7 @@ To build dashboard for production, you still need to install `bc`. ...@@ -70,7 +70,7 @@ To build dashboard for production, you still need to install `bc`.
The Dashboard project can be built for production by using the following task: The Dashboard project can be built for production by using the following task:
``` ```shell
npm run build npm run build
``` ```
...@@ -78,7 +78,7 @@ The code is compiled, compressed, i18n support is enabled and debug support remo ...@@ -78,7 +78,7 @@ The code is compiled, compressed, i18n support is enabled and debug support remo
To build and immediately serve Dashboard from the `dist` folder, use the following task: To build and immediately serve Dashboard from the `dist` folder, use the following task:
``` ```shell
npm run start:prod npm run start:prod
``` ```
...@@ -88,13 +88,13 @@ Open a browser and access the UI under `localhost:9090`. The following processes ...@@ -88,13 +88,13 @@ Open a browser and access the UI under `localhost:9090`. The following processes
To build the docker image on darwin OS you will need to set environment variable for go to build as linux: To build the docker image on darwin OS you will need to set environment variable for go to build as linux:
``` ```shell
export GOOS=linux export GOOS=linux
``` ```
In order to package everything into a ready-to-run Docker image, use the following task: In order to package everything into a ready-to-run Docker image, use the following task:
``` ```shell
npm run docker:build:head npm run docker:build:head
``` ```
...@@ -104,29 +104,29 @@ You might notice that the Docker image is very small and requires only a few MB. ...@@ -104,29 +104,29 @@ You might notice that the Docker image is very small and requires only a few MB.
Unit tests should be executed after every source code change. The following task makes this a breeze. The full test suite includes unit tests and integration tests. Unit tests should be executed after every source code change. The following task makes this a breeze. The full test suite includes unit tests and integration tests.
``` ```shell
npm run test npm run test
``` ```
You can also run individual tests on their own (such as the backend or frontend tests) by doing the following: You can also run individual tests on their own (such as the backend or frontend tests) by doing the following:
``` ```shell
npm run test:frontend npm run test:frontend
``` ```
or or
``` ```shell
npm run test:backend npm run test:backend
``` ```
The code style check suite includes format checks can be executed with: The code style check suite includes format checks can be executed with:
``` ```shell
npm run check npm run check
``` ```
The code formatting can be executed with: The code formatting can be executed with:
``` ```shell
npm run fix npm run fix
``` ```
...@@ -140,7 +140,7 @@ Since the hooks for commit has been set with `husky` into `<dashboard_home>/.git ...@@ -140,7 +140,7 @@ Since the hooks for commit has been set with `husky` into `<dashboard_home>/.git
Then you can commit your changes and push them to your fork: Then you can commit your changes and push them to your fork:
``` ```shell
git commit git commit
git push -f origin my-feature git push -f origin my-feature
``` ```
......
...@@ -47,7 +47,7 @@ Since dashboard team can not review translation files in your language, so dashb ...@@ -47,7 +47,7 @@ Since dashboard team can not review translation files in your language, so dashb
3. Run `npm run fix:i18n`. Then translation file for your language, e.g. `i18n/fr/messages.fr.xlf`, would be generated in your locale directory. 3. Run `npm run fix:i18n`. Then translation file for your language, e.g. `i18n/fr/messages.fr.xlf`, would be generated in your locale directory.
4. Open your translation file and translate texts in `<target>` element into your language, and remove `state="new"` to mark it as translated. 4. Open your translation file and translate texts in `<target>` element into your language, and remove `state="new"` to mark it as translated.
5. To build dashboard for your language, add your locale into `locales` in `angular.json` like follow: 5. To build dashboard for your language, add your locale into `locales` in `angular.json` like follow:
``` ```json
"ja": { "ja": {
"translation": "i18n/ja/messages.ja.xlf", "translation": "i18n/ja/messages.ja.xlf",
"baseHref": "" "baseHref": ""
...@@ -57,13 +57,13 @@ Since dashboard team can not review translation files in your language, so dashb ...@@ -57,13 +57,13 @@ Since dashboard team can not review translation files in your language, so dashb
After preparation of new translation file, configure `i18n/locale_conf.json` file to support translated dashboard as follows: After preparation of new translation file, configure `i18n/locale_conf.json` file to support translated dashboard as follows:
``` ```json
{"translations": [ "en", "fr", "ko", "zh" ]} {"translations": [ "en", "fr", "ko", "zh" ]}
``` ```
To add Japanese translation file, add `"ja"` into `"translations"` array in alphabetical order. To add Japanese translation file, add `"ja"` into `"translations"` array in alphabetical order.
``` ```json
{"translations": [ "en", "fr", "ja", "ko", "zh" ]} {"translations": [ "en", "fr", "ja", "ko", "zh" ]}
``` ```
...@@ -71,7 +71,7 @@ Then you can build your localized dashboard with `npm run build`. ...@@ -71,7 +71,7 @@ Then you can build your localized dashboard with `npm run build`.
Before submit Pull Request, add `i18n/[locale]/OWNERS` file for your translation team like below: Before submit Pull Request, add `i18n/[locale]/OWNERS` file for your translation team like below:
``` ```yaml
approvers: approvers:
- [your github account] - [your github account]
- [and more approvers' github account] - [and more approvers' github account]
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册