Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 14 additions & 3 deletions .github/workflows/tranlate-languages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,22 @@ jobs:
- uses: actions/checkout@v3
- name: Building phoenix
env:
GCP_API_KEY: ${{ secrets.GCP_API_KEY }}
GCP_PROJECT_ID: ${{ secrets.GCP_PROJECT_ID }}
CORE_AI_TRANSLATE_API_KEY: ${{ secrets.CORE_AI_TRANSLATE_API_KEY }}
run: |
npm ci
npm run _translateStrings
ls -al docs
ls -al src/nls
shell: bash

- name: Check translation errors file
id: check-errors
run: |
if [ -f src/nls/errors.txt ]; then
echo "errors_found=true" >> $GITHUB_ENV
else
echo "errors_found=false" >> $GITHUB_ENV
fi

- name: Create Translation Pull Request
id: cpr
uses: peter-evans/create-pull-request@v4
Expand All @@ -32,6 +40,9 @@ jobs:
body: |
Update string translations
- Auto-generated by `tranlate-languages.yml` action

Errors:
${{ env.errors_found == 'true' && 'Errors: Some errors were found, please see GitHub Actions logs.' || 'No Translation Errors. All good!' }}
- name: Check outputs
if: ${{ steps.cpr.outputs.pull-request-number }}
run: |
Expand Down
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,9 @@ test/thirdparty/jasmine-reporters
/build/config.json
/build/jsdoc.json

# translations
/src/nls/errors.txt


# ignore everything in the dev extension directory EXCEPT the README
# (so that the directory is non-empty and can be in git)
Expand Down
5 changes: 2 additions & 3 deletions docs/02-Adding-Translations.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,10 @@ A special folder called the `root` folder houses the reference English translati
Each `src/nls/<locale>` folder contains similar files, plus a few additional ones:
1. `expertTranslations.json` where you can provide expert translations for specific English strings to locale strings. This expert translation will be used instead of machine translations if present for a string.
2. `strings.js` - The full list of translated text for the locale.
3. Apart from the above two there are 2 autogenerated files that should not be edited: `lastTranslated.json` and `lastTranslatedLocale.json`.
3. Apart from the above two there are 2 autogenerated files that should not be edited: `lastTranslated.json`.

## Autogenerated and Manual translations
When any string changes are made to `src/nls/root/strings.js` or any `src/nls/<locale>/strings.js`, it will automatically be scanned by GitHub Actions and the corresponding translations will be generated. A pull request will be raised with the new translations.
When any string changes are made to `src/nls/root/strings.js` , it will automatically be scanned by GitHub Actions and the corresponding translations will be generated. A pull request will be raised with the new translations.

You can also run the translation command locally if you have the AWS/GCP keys with the command. This is mostly FYI for phoenix internal devs.
```bash
Expand All @@ -57,7 +57,6 @@ Say we want to add a new language translation `ko`. We have to do the following
2. In file `nls/root/strings-app.js` add the line `"LOCALE_KO": "한국어",` where `한국어` is `Korean` in Korean language.
3. Create a new folder `nls/ko`.
4. Create a new file `nls/ko/strings.js` with the content `define({});`
5. Create three new files `nls/ko/lastTranslated.json`, `nls/ko/lastTranslatedLocale.json` and
`nls/ko/expertTranslations.json` with the content `{}`

Once the code is checked in, the translation will be auto generated.
Expand Down
162 changes: 162 additions & 0 deletions docs/API-Reference/command/Commands.md
Original file line number Diff line number Diff line change
Expand Up @@ -885,3 +885,165 @@ Hides the sidebar
Shows the sidebar

**Kind**: global variable
<a name="CMD_GIT_INIT"></a>

## CMD\_GIT\_INIT
Initializes a new git repository

**Kind**: global variable
<a name="CMD_GIT_CLONE"></a>

## CMD\_GIT\_CLONE
Clones a git repository

**Kind**: global variable
<a name="CMD_GIT_CLONE_WITH_URL"></a>

## CMD\_GIT\_CLONE\_WITH\_URL
Clones a git repository with a specific URL

**Kind**: global variable
<a name="CMD_GIT_SETTINGS_COMMAND_ID"></a>

## CMD\_GIT\_SETTINGS\_COMMAND\_ID
Opens git settings

**Kind**: global variable
<a name="CMD_GIT_CLOSE_UNMODIFIED"></a>

## CMD\_GIT\_CLOSE\_UNMODIFIED
Closes unmodified files

**Kind**: global variable
<a name="CMD_GIT_CHECKOUT"></a>

## CMD\_GIT\_CHECKOUT
Checks out a branch or commit

**Kind**: global variable
<a name="CMD_GIT_RESET_HARD"></a>

## CMD\_GIT\_RESET\_HARD
Performs a hard reset

**Kind**: global variable
<a name="CMD_GIT_RESET_SOFT"></a>

## CMD\_GIT\_RESET\_SOFT
Performs a soft reset

**Kind**: global variable
<a name="CMD_GIT_RESET_MIXED"></a>

## CMD\_GIT\_RESET\_MIXED
Performs a mixed reset

**Kind**: global variable
<a name="CMD_GIT_TOGGLE_PANEL"></a>

## CMD\_GIT\_TOGGLE\_PANEL
Toggles the git panel

**Kind**: global variable
<a name="CMD_GIT_GOTO_NEXT_CHANGE"></a>

## CMD\_GIT\_GOTO\_NEXT\_CHANGE
Goes to next git change

**Kind**: global variable
<a name="CMD_GIT_GOTO_PREVIOUS_CHANGE"></a>

## CMD\_GIT\_GOTO\_PREVIOUS\_CHANGE
Goes to previous git change

**Kind**: global variable
<a name="CMD_GIT_COMMIT_CURRENT"></a>

## CMD\_GIT\_COMMIT\_CURRENT
Commits current file changes

**Kind**: global variable
<a name="CMD_GIT_COMMIT_ALL"></a>

## CMD\_GIT\_COMMIT\_ALL
Commits all changes

**Kind**: global variable
<a name="CMD_GIT_FETCH"></a>

## CMD\_GIT\_FETCH
Fetches from remote

**Kind**: global variable
<a name="CMD_GIT_PULL"></a>

## CMD\_GIT\_PULL
Pulls from remote

**Kind**: global variable
<a name="CMD_GIT_PUSH"></a>

## CMD\_GIT\_PUSH
Pushes to remote

**Kind**: global variable
<a name="CMD_GIT_REFRESH"></a>

## CMD\_GIT\_REFRESH
Refreshes git status

**Kind**: global variable
<a name="CMD_GIT_TAG"></a>

## CMD\_GIT\_TAG
Creates a git tag

**Kind**: global variable
<a name="CMD_GIT_DISCARD_ALL_CHANGES"></a>

## CMD\_GIT\_DISCARD\_ALL\_CHANGES
Discards all changes

**Kind**: global variable
<a name="CMD_GIT_UNDO_LAST_COMMIT"></a>

## CMD\_GIT\_UNDO\_LAST\_COMMIT
Undoes the last commit

**Kind**: global variable
<a name="CMD_GIT_CHANGE_USERNAME"></a>

## CMD\_GIT\_CHANGE\_USERNAME
Changes git username

**Kind**: global variable
<a name="CMD_GIT_CHANGE_EMAIL"></a>

## CMD\_GIT\_CHANGE\_EMAIL
Changes git email

**Kind**: global variable
<a name="CMD_GIT_GERRIT_PUSH_REF"></a>

## CMD\_GIT\_GERRIT\_PUSH\_REF
Pushes to Gerrit code review

**Kind**: global variable
<a name="CMD_GIT_AUTHORS_OF_SELECTION"></a>

## CMD\_GIT\_AUTHORS\_OF\_SELECTION
Shows authors of selected code

**Kind**: global variable
<a name="CMD_GIT_AUTHORS_OF_FILE"></a>

## CMD\_GIT\_AUTHORS\_OF\_FILE
Shows authors of current file

**Kind**: global variable
<a name="CMD_GIT_TOGGLE_UNTRACKED"></a>

## CMD\_GIT\_TOGGLE\_UNTRACKED
Toggles display of untracked files

**Kind**: global variable
2 changes: 1 addition & 1 deletion docs/API-Reference/command/KeyBindingManager.md
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ Returns record(s) for valid key binding(s).
| Param | Type | Description |
| --- | --- | --- |
| command | <code>string</code> \| <code>Command</code> | A command ID or command object |
| keyBindings | <code>Object</code> | A single key binding or an array of keybindings. In an array of keybinding `platform` property is also available. Example: "Shift-Cmd-F". Mac and Win key equivalents are automatically mapped to each other. Use displayKey property to display a different string (e.g. "CMD+" instead of "CMD="). |
| keyBindings | <code>Object</code> | A single key binding or an array of keybindings. In an array of keybinding `platform` property is also available. Example: "Shift-Cmd-F". Mac and Win key equivalents are automatically mapped to each other. Use displayKey property to display a different string (e.g. "CMD+" instead of "CMD="). if browserOnly is true, then the shortcut will only apply in browser if nativeOnly is set, the shortcut will only apply in native apps |
| platform | <code>string</code> | The target OS of the keyBindings either "mac", "win" or "linux". If undefined, all platforms not explicitly defined will use the key binding. NOTE: If platform is not specified, Ctrl will be replaced by Cmd for "mac" platform |
| options | <code>object</code> | |
| options.isMenuShortcut | <code>boolean</code> | this allows alt-key shortcuts to be registered. |
Expand Down
Loading
Loading