https://github.com/okturtles/strings
Powerful and simple localization utility for web applications
https://github.com/okturtles/strings
Last synced: about 1 year ago
JSON representation
Powerful and simple localization utility for web applications
- Host: GitHub
- URL: https://github.com/okturtles/strings
- Owner: okTurtles
- License: mpl-2.0
- Created: 2020-03-08T19:56:41.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2024-04-06T14:20:49.000Z (about 2 years ago)
- Last Synced: 2025-04-01T00:51:12.445Z (about 1 year ago)
- Language: OCaml
- Homepage:
- Size: 2 MB
- Stars: 6
- Watchers: 3
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# String Extractor
The String Extractor is a program that runs on your computer to help manage translations.
## Help translate a language
You can contribute by directly making changes to the `.strings` file for the language of your choice. Those files are located in the `strings/` directory. If the language of your choice is not present yet, follow the instructions in [Add a language](#Add-a-language).
Feel free to make edits directly on Github!
Example (`french.strings`):
**before**
```
/* MISSING TRANSLATION - frontend/views/pages/Home.vue */
"Logout" = "Logout";
/* MISSING TRANSLATION - frontend/views/containers/contributions/ContributionsWidget.vue */
"You and {count} other members are contributing." = "You and {count} other members are contributing.";
```
**after**
```
/* frontend/views/pages/Home.vue */
"Logout" = "Déconnexion";
/* frontend/views/containers/contributions/ContributionsWidget.vue */
"You and {count} other members are contributing." = "Vous, ainsi que {count} autres membres, contribuez.";
```
Notes:
- The original English text is on the left and must not be changed.
- Removing `MISSING TRANSLATION` is not necessary.
- Text is enclosed within double quotes.
- Do not modify text enclosed within `{` and `}`, but you can move it.
- To represent the double quote character itself (`"`), use `\"`.
- To represent the backslash character itself (`\`), use `\\`.
## Add a language
1. Make a copy of `english.strings` and rename it to e.g. `french.strings`
2. Start translating `french.strings`!
## Developers
Download the latest version of the String Extractor [here](https://github.com/okTurtles/strings/releases).
Place it at the root of the repository.
Simply run it before submitting a Pull Request!
```sh
# MacOS
./strings.mac src/
# getting a 'code cannot be verified' error? Run this:
# xattr -d com.apple.quarantine strings.mac
# Linux
tar xzvf strings.linux.tar.gz # unzip
./strings.linux src/
```
- **MacOS**: Monterey or newer
- **Linux** and **WSL**
- Ubuntu 20.04 or newer
- Debian 11 (Bullseye) or newer
- You'll need to install your Linux distribution's `musl` package: `apt-get install musl`
- Make sure the `lib` directory stays in the same directory as `strings.linux`