1.1.82 • Published 3 days ago

@dydxprotocol/v4-localization v1.1.82

Weekly downloads
-
License
AGPL-3.0
Repository
github
Last release
3 days ago

Translation structures

There are four folders for translations.

/config/localization /config/localization_notifications /config/localizations_native /marketing

Each of them contains a list of language folders, such as /en (English) /es (Spanish) /fr (French) /ja (Japanese) /ko (Korean) /pt (Portugal) /ru (Russian) /tr (Turkey) /zh-CN (Simplified Chinese)

Each folder contains either a list of JSON files ending .json, or text files ending .txt

Syntax and Structure

Text that goes within tooltip pop ups should go in the config/localization/{language}/tooltips.json Other text goes to config/localization/{language}/app.json

Within each json file, find the component/view that your text belongs in (or create a new key for it) and your text.

Typically, tooltips will have both TITLE and BODY text.

Parameters

If you need to inject dynamic text or other values, use {} to notate an input parameter.

Ex:

"SOME_TEXT": "A zebra has {ZEBRA_PATTERN} stripes"

The term within the {} will be the name of the variable used to inject your dynamic values. Parameters are quite flexible - you can even insert react components (as long as they can be rendered properly).

Work with Github

The "main" branch cannot be written directly. You must create a separate branch, make the changes there, commit and push the branch, and then create a PR (Push request) to "main"

For your branch, recommend to use "/changes/{language-code}-{date}" as the branch name.

For example, if you are working on Spanish, and started the work on July 13th, 2022, use the branch name "/changes/es-2022-07-13".

Once your PR is accepted and merged into "main", the branch is removed from the repo. Create a new branch for next batch of changes.

Committing Changes

Before committing your changes to the repo, you need to run the following commands:

npm run generate to auto generate required code

npm version patch to update the package version number

JSON Translations

Please translate each JSON entry, using the file in /en folder as the original, and translate into the same file name in other language files.

For example, there is a /config/localization/en/app.json file. It should be translated into Spanish in /config/localization/es/app.json file.

The key should stay the same. The value should be translated. For example "YOUR_POSITION_WAS_LIQUIDATED": "Your position was liquidated." is translated to Spanish as "YOUR_POSITION_WAS_LIQUIDATED": "Tu posición ha sido liquidada."

You will see curly brackets in some cases. Keep the text in the curly brackets as is. For example "LEAGUES_LAUNCH_BODY": "Climb the rankings ladder to earn your share of the {PRIZE}." is translated to Spanish as "LEAGUES_LAUNCH_BODY": "Asciende en la clasificación para ganar tu parte del {PRIZE}.",

"{PRIZE}" should not be translated.

Make sure the JSON format is still valid. Recommend to use https://jsonformatter.curiousconcept.com to validate the translated JSON

TXT Translations

Text files can be translated as a single unit.

Generating app.ts

''' ./codegen_localization_app.swift ../config/localization/en/app.json > ./generated/app.ts '''

Generating tooltips.ts

''' ./codegen_localization_tooltips.swift ../config/localization/en/tooltips.json > ./generated/tooltips.ts '''

Generating notifications.ts

''' ./codegen_localization_notifications.swift ../config/localization_notifications/en/app.json > ./generated/notifications.ts '''

1.1.82

3 days ago

1.1.81

7 days ago

1.1.78

8 days ago

1.1.79

8 days ago

1.1.80

8 days ago

1.1.77

9 days ago

1.1.76

10 days ago

1.1.70

13 days ago

1.1.74

13 days ago

1.1.73

13 days ago

1.1.72

13 days ago

1.1.71

13 days ago

1.1.75

13 days ago

1.1.67

14 days ago

1.1.69

13 days ago

1.1.68

14 days ago

1.1.66

16 days ago

1.1.65

17 days ago

1.1.64

27 days ago

1.1.63

29 days ago

1.1.62

29 days ago

1.1.61

30 days ago

1.1.60

1 month ago

1.1.59

1 month ago

1.1.58

1 month ago

1.1.57

1 month ago

1.1.56

1 month ago

1.1.55

1 month ago

1.1.54

1 month ago

1.1.53

1 month ago

1.1.52

1 month ago

1.1.51

2 months ago

1.1.50

2 months ago

1.1.49

2 months ago

1.1.48

2 months ago

1.1.47

2 months ago

1.1.46

2 months ago

1.1.45

2 months ago

1.1.44

2 months ago

1.1.41

2 months ago

1.1.43

2 months ago

1.1.42

2 months ago

1.1.40

2 months ago

1.1.38

2 months ago

1.1.37

2 months ago

1.1.39

2 months ago

1.1.36

2 months ago

1.1.35

3 months ago

1.1.34

3 months ago

1.1.33

3 months ago

1.1.32

3 months ago

1.1.31

3 months ago

1.1.30

3 months ago

1.1.29

3 months ago

1.1.28

3 months ago

1.1.27

3 months ago

1.1.26

3 months ago

1.1.25

3 months ago

1.1.24

3 months ago

1.1.23

3 months ago

1.1.22

3 months ago

1.1.21

3 months ago

1.1.20

3 months ago

1.1.19

3 months ago

1.1.18

3 months ago

1.1.16

4 months ago

1.1.17

3 months ago

1.1.15

4 months ago

1.1.14

4 months ago

1.1.13

4 months ago

1.1.12

4 months ago

1.1.11

4 months ago

1.1.10

4 months ago

1.1.9

4 months ago

1.1.8

4 months ago

1.1.7

4 months ago

1.1.6

4 months ago

1.1.1

5 months ago

1.1.5

5 months ago

1.1.4

5 months ago

1.1.3

5 months ago

1.1.2

5 months ago

1.1.0

5 months ago

1.0.19

5 months ago

1.0.18

5 months ago

1.0.17

5 months ago

1.0.16

5 months ago

1.0.15

5 months ago

1.0.14

5 months ago

1.0.13

5 months ago

1.0.12

5 months ago

1.0.11

5 months ago

1.0.10

5 months ago

1.0.9

5 months ago

1.0.8

5 months ago

1.0.7

5 months ago

1.0.6

6 months ago

1.0.5

6 months ago

1.0.4

6 months ago

1.0.3

6 months ago

1.0.2

6 months ago

1.0.1

6 months ago

1.0.0

7 months ago

0.1.36

7 months ago

0.1.35

7 months ago

0.1.34

7 months ago

0.1.32

7 months ago

0.1.31

7 months ago

0.1.30

7 months ago

0.1.29

7 months ago

0.1.28

7 months ago

0.1.27

7 months ago

0.1.26

7 months ago

0.1.25

7 months ago

0.1.24

7 months ago

0.1.23

7 months ago

0.1.22

7 months ago

0.1.21

7 months ago

0.1.20

7 months ago

0.1.19

7 months ago

0.1.18

7 months ago

0.1.17

7 months ago

0.1.16

7 months ago

0.1.15

7 months ago

0.1.14

7 months ago

0.1.13

8 months ago

0.1.12

8 months ago

0.1.11

8 months ago

0.1.10

8 months ago

0.1.9

8 months ago

0.1.8

8 months ago

0.1.7

8 months ago

0.1.6

8 months ago

0.1.5

8 months ago

0.1.4

8 months ago

0.1.3

8 months ago

0.1.2

8 months ago

0.1.1

8 months ago

0.1.0

8 months ago

0.0.25

8 months ago

0.0.24

8 months ago

0.0.23

8 months ago

0.0.22

8 months ago

0.0.21

8 months ago

0.0.20

8 months ago

0.0.19

8 months ago

0.0.18

8 months ago

0.0.17

8 months ago

0.0.16

8 months ago

0.0.15

8 months ago

0.0.14

8 months ago

0.0.13

8 months ago

0.0.12

8 months ago

0.0.11

8 months ago

0.0.10

9 months ago

0.0.9

9 months ago

0.0.8

9 months ago

0.0.7

9 months ago

0.0.6

9 months ago