npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@dydxprotocol/v4-localization

v1.1.259

Published

v4 localization

Downloads

1,372

Readme

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 '''