Skip to content

Commit

Permalink
Squashed 'Scribe/i18n/' changes from 5bd9672..8c13530
Browse files Browse the repository at this point in the history
8c13530 Merge pull request scribe-org#73 from yerimmii/ko-json
bc78915 Create ko.json
3f2a3de Minor edit to .gitignore for spacing
e40d892 Merge pull request scribe-org#72 from axif0/bangla
1afc6ea Creating Bangla localization
23c56ed Merge pull request scribe-org#70 from KesharwaniArpita/ArpitaContributionsMarathi
d49ed68 Create string.xml
7dc4b73 Create mr.json (Marathi)
6bc6502 Merge pull request scribe-org#69 from axif0/work
933237d Update pr_maintainer_checklist.yaml
fa75400 Merge pull request scribe-org#68 from OmarAI2003/MSA-internationalization
329ad53 Translate from en to ar
c81e3a1 Add Arabic translation file (ar.json) for localization support
45bce87 Merge pull request scribe-org#66 from OmarAI2003/improve-android-convert-str-to-json
b774027 Minor spacing and removing permissions error
a3eeda1 Merge pull request scribe-org#67 from weblate/weblate-scribe-scribe-i18n
c67255b Translated using Weblate (Spanish)
7054971 fix: add check for missing values_directory
a90a040 Error handling for file read and write operations
9295291 Use a single variable for the 'jsons' folder path and add error handling for missing 'jsons' folder.
5e85b16 Merge pull request scribe-org#64 from OmarAI2003/improve-android-convert-jsons-to-strings
94482ef Added docstrings to Android string conversion functions
2a7b35b for the recently supported language: adding the 'hi' language folder generated by the script to prevent 'directory not found' errors when testing the reverse conversion (JSON to strings).
13a4849 small fix to the lang_dir
e5ca964 Refactor: Pre-load language JSON files before generating strings.xml files
f8ffe63 Use a single variable for the 'jsons' folder path and add error handling for missing 'jsons' folder.
7dbeaa1 Merge pull request scribe-org#62 from OmarAI2003/improve-convert-jsons-to-xcstrings
a3e5fbf Minor edits to script spacing and comments
5fb2fc5 Merge pull request scribe-org#63 from KesharwaniArpita/ArpitaContributionsHindi
fd91955 Create hi.json
9fcc0de fix: update inline comments to start with lowercase as per style guide.
8925a4b Rename variable for improved clarity
aee58c0 Add error handling for missing base language file
d41c8eb Remove automatic creation of the 'jsons' folder
d811de7 Optimize performance by pre-loading language JSON files
81da648 Refactor: Use a single variable for the 'jsons' folder path and ensure it exists.
f354bb4 Fix file handling: Use context managers to ensure safe reading and writing of files.
13d52f2 Merge pull request scribe-org#58 from OmarAI2003/improve-convert-xcstrings-to-jsons
8b13ee6 Fix to en.json being written rather than en-US + minor edits
2a7e03d Merge pull request scribe-org#61 from weblate/weblate-scribe-scribe-i18n
f0abf87 Translated using Weblate (French)
6c4acae Merge pull request scribe-org#60 from OmarAI2003/fix-typo-in-readme.md
d30380a Revert: Move Localizable.xcstrings back to original location
46a68da moved Localizable.xcstrings again where it was as andrew told me
d426a4b Fix typo in README: Changed 'an tools' to 'tools'
0d48009  made the changes as per the feedback and added Localizable.xcstrings to 'jsons' directory
42e76dd Improve language handling and ensure directory creation
b1ccff7 Refactor: Use context manager for writing JSON files to ensure proper file handling.
5b97d83 Add JSON loading error handling in convert_xcstrings_to_jsons.py
32b8f70 Improve file handling in convert_xcstrings_to_jsons.py
7536be6 Update app menu headings to not include second word caps
c286cf2 Merge pull request scribe-org#50 from weblate/weblate-scribe-scribe-i18n
3038710 Translated using Weblate (Spanish)
b80ddc7 Translated using Weblate (Spanish)
faf7ce3 Various fixes of strings and adding conjugate keys
1eb7d47 Minor update to readme headers
04574f8 Remove unused keys and fix colon spacing
8492a7a Make sure that application names are not localized
0ac6710 Merge pull request #48 from weblate/weblate-scribe-scribe-i18n
80708cb Translated using Weblate (Spanish)
dd15564 Merge pull request #47 from weblate/weblate-scribe-scribe-i18n
f05f74d Translated using Weblate (Spanish)
5701774 Add missing and update incorrect strings
c0a45c2 Merge pull request #46 from angrezichatterbox/Run-Json-to-XML-Scripts
3af18ab feat:Ran the script for converting json to xml
935903a Edit working directory for conversion workflows to try to fix error
c60a196 Merge pull request #45 from weblate/weblate-scribe-scribe-i18n
fc18213 Translated using Weblate (Spanish)
872d232 Set working directory for conversion scripts
2f6f5ab Fix incorrect keys in translation language JSONs
feb4a18 Edit to conversion scripts to fix their paths with relation to root
d6cce32 Fix German GitHub key
c26c78d Add all app texts for scribe + conjugate with new keys
ad588cc Update the suggested room based on new room name
1e07813 Merge pull request #42 from angrezichatterbox/XML-TO-JSON-FIX
2a8fe2a fix:Added escape characters for \n
924f00c scribe-org#37 minor edits to conversion scripts and try new command path
aafa0f6 scribe-org#37 update Scribe-i18n structure and fix conversion workflow
6a8faaa Merge pull request scribe-org#39 from Jag-Marcel/i18n-refactor
2b9caff Added newline at end of all JSON files
e775e46 Updated jsons and xcstrings file using new iOS scripts
dd018c1 Refactored iOS conversion scripts to use python json package
7f8c273 Updated conversion workflow to use paths filter instead of conditional check
ff21cdb Refactored scripts into new iOS and Android folders
700a3ce Update Android strings given new conversion script
1ba25e6 Remove reference to contribution guide as it's been removed
5f38e75 Merge pull request scribe-org#38 from angrezichatterbox/special_character_check_xml
40d1edb feat:Added special character replacement in the Script
d9a35d7 Minor update of readme to make subtree creation more clear
10b07b5 Merge pull request scribe-org#36 from angrezichatterbox/xml_conversion
dcad620 Run stings conversion script + workflow for Android + docs
8b65382 feat:Added script for conversion from strings.xml to json
cea2273 feat:Added script for conversion from json to strings.xml
b25df32 Revert change to conversion to see if adding the full path will make it work
18d50ca Merge pull request scribe-org#35 from Jag-Marcel/xcode-script-fix
b8a1598 Merge pull request scribe-org#34 from wkyoshida/20
7aeba36 Removed conditional from action
cf9878e docs: Add documentation on using Scribe-i18n as a git subtree
307cadc Merge pull request scribe-org#33 from Jag-Marcel/xcode-script-fix
44fa905 Removed quotes around bool value

git-subtree-dir: Scribe/i18n
git-subtree-split: 8c13530b51716c2e2f38be2565b6ef1f5a3d4188
  • Loading branch information
andrewtavis committed Nov 9, 2024
1 parent b2b1dcf commit 5028b34
Show file tree
Hide file tree
Showing 41 changed files with 3,608 additions and 950 deletions.
23 changes: 23 additions & 0 deletions .github/workflows/json_conversion.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: json_conversion

on:
push:
branches:
- main
paths:
- "Scribe-i18n/jsons/**.json"

jobs:
# Run JSON to app strings conversion scripts if needed.
convert_json:
runs-on: ubuntu-latest
steps:
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: 3.12
- name: Execute scripts to convert JSONs to app files
working-directory: scripts
run: |
python android/convert_jsons_to_strings.py
python ios/convert_jsons_to_xcstrings.py
11 changes: 9 additions & 2 deletions .github/workflows/pr_maintainer_checklist.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,17 @@ jobs:
The Scribe team will do our best to address your contribution as soon as we can. The following is a checklist for maintainers to make sure this process goes as well as possible. Feel free to address the points below yourself in further commits if you realize that actions are needed :)
If you're not already a member of our [public Matrix community](https://matrix.to/#/#scribe_community:matrix.org), please consider joining! We'd suggest using [Element](https://element.io/) as your Matrix client, and definitely join the General and Localization rooms once you're in. Also consider joining our [bi-weekly Saturday dev syncs](https://etherpad.wikimedia.org/p/scribe-dev-sync). It'd be great to have you!
If you're not already a member of our [public Matrix community](https://matrix.to/#/#scribe_community:matrix.org), please consider joining! We'd suggest using [Element](https://element.io/) as your Matrix client, and definitely join the General and i18n rooms once you're in. Also consider joining our [bi-weekly Saturday dev syncs](https://etherpad.wikimedia.org/p/scribe-dev-sync). It'd be great to have you!
### Maintainer checklist
- name: First PR Contributor Email Check
id: first_interaction
uses: actions/first-interaction@v1
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
pr-message: |
## First PR Commit Check
- [ ] The commit messages for the remote branch should be checked to make sure the contributor's email is set up correctly so that they receive credit for their contribution
- The contributor's name and icon in remote commits should be the same as what appears in the PR
- If there's a mismatch, the contributor needs to make sure that the [email they use for GitHub](https://github.com/settings/emails) matches what they have for `git config user.email` in their local activist repo
42 changes: 0 additions & 42 deletions .github/workflows/xcstrings_conversion.yml

This file was deleted.

3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,4 @@
**/.DS_Store

venv
.venv
39 changes: 31 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
[![mastodon](https://img.shields.io/badge/Mastodon-6364FF.svg?logo=mastodon&logoColor=ffffff)](https://wikis.world/@scribe)
[![matrix](https://img.shields.io/badge/Matrix-000000.svg?logo=matrix&logoColor=ffffff)](https://matrix.to/#/#scribe_community:matrix.org)

## Application text localization files for Scribe apps
### Application text localization files for Scribe apps

**Scribe-i18n** is the home of the localization files that are included in each Scribe application. Scribe uses [Weblate](https://weblate.org/en/) for localization! Head over to [weblate.org/projects/scribe/scribe-i18n](https://hosted.weblate.org/projects/scribe/scribe-i18n) to localize the applications. Changes in this directory will be merged into other Scribe applications via this repo being a [Git subtree](https://docs.github.com/en/get-started/using-git/about-git-subtree-merges).

Expand All @@ -24,13 +24,13 @@ Check out Scribe's [architecture diagrams](https://github.com/scribe-org/Organiz

# **Contents**

- [Localization coverage](#localization-coverage)
- [Localization Coverage](#localization-coverage)
- [Contributing](#contributing)
- [Community](#community)

<a id="localization-coverage"></a>

# Localization coverage [``](#contents)
# Localization Coverage [``](#contents)

<a href="https://hosted.weblate.org/projects/scribe/scribe-i18n">
<img src="https://hosted.weblate.org/widget/scribe/scribe-i18n/multi-auto.svg" alt="Translation status" />
Expand All @@ -40,7 +40,7 @@ Check out Scribe's [architecture diagrams](https://github.com/scribe-org/Organiz

# Contributing [``](#contents)

Thank you for your interest in contributing to Scribe-i18n! We look forward to welcoming you to the community and working with you to build an tools for language learners to communicate effectively :) The following are some suggested steps for people interested in joining our community.
Thank you for your interest in contributing to Scribe-i18n! We look forward to welcoming you to the community and working with you to build tools for language learners to communicate effectively :) The following are some suggested steps for people interested in joining our community.

Following these guidelines helps to communicate that you respect the time of the developers managing and developing this open-source project. In return, and in accordance with this project's [code of conduct](https://github.com/scribe-org/Scribe-i18n/blob/main/.github/CODE_OF_CONDUCT.md), other contributors will reciprocate that respect in addressing your issue or assessing changes and features.

Expand All @@ -52,7 +52,7 @@ If you have questions or would like to communicate with the team, please [join u

The [issue tracker for Scribe-i18n](https://github.com/scribe-org/Scribe-i18n/issues) is the preferred channel to let the team know if there are problems with localizations or to ask to work on new ones. Those interested in helping can check the [`-next release-`](https://github.com/scribe-org/Scribe-i18n/labels/-next%20release-) and [`-priority-`](https://github.com/scribe-org/Scribe-i18n/labels/-priority-) labels in the [issues](https://github.com/scribe-org/Scribe-i18n/issues) for those that are most important, as well as those marked [`good first issue`](https://github.com/scribe-org/Scribe-i18n/issues?q=is%3Aissue+is%3Aopen+label%3A%22good+first+issue%22) that are tailored for first time contributors. Generally issues in this repository will be marked with the [`localization`](https://github.com/scribe-org/Scribe-i18n/issues?q=is%3Aopen+is%3Aissue+label%3Alocalization) label.

### Localizing via Weblate [``](#contents)
### Localizing Via Weblate [``](#contents)

<a href="https://hosted.weblate.org/projects/scribe/scribe-i18n"><img src="https://raw.githubusercontent.com/scribe-org/Organization/main/resources/images/logos/WeblateLogo.png" height="100" alt="Visit Weblate project" align="right"></a>

Expand All @@ -78,11 +78,20 @@ The [issue tracker for Scribe-i18n](https://github.com/scribe-org/Scribe-i18n/is

- Changes are also automatically sent every 24 hours

7. Scribe-i18n directories that are [Git subtrees](https://docs.github.com/en/get-started/using-git/about-git-subtree-merges) in other Scribe application repos are then synched
7. Scribe-i18n directories that are [Git subtrees](https://docs.github.com/en/get-started/using-git/about-git-subtree-merges) in other Scribe application repos are then synched. For each project using Scribe-i18n:

- Navigate to the root of the Scribe project's repo
- To load into the project the latest Scribe-i18n updates, run the following - where `subtree-directory` is the directory within the repo structure with the Scribe-i18n subtree:

```bash
git subtree pull --prefix <subtree-directory> [email protected]:scribe-org/Scribe-i18n.git main --squash
```

- From the above command, two commits are then auto-generated. Finally, create the PR to the given project to bring in the Scribe-i18n updates.

Thanks so much for your interest in supporting Scribe's localization!
### Adding source strings [``](#contents)
### Adding Source Strings [`⇧`](#contents)
The base language for all Scribe applications is US English. If you'd like to edit the [en-US.json](https://github.com/scribe-org/Scribe-i18n/blob/main/Scribe-i18n/en-US.json) file, please [fork](https://docs.github.com/en/get-started/quickstart/fork-a-repo) the repo, clone your fork, and configure the remotes:

Expand Down Expand Up @@ -118,6 +127,20 @@ git remote add upstream https://github.com/scribe-org/Scribe-i18n.git

If all looks good, then you're ready to start adding localizable key-string pairs via pull requests!
### File Conversion
The files in the [Scribe-i18n/scripts](https://github.com/scribe-org/Scribe-i18n/tree/main/Scribe-i18n/scripts) directory can be used to convert base localization JSON files into the filetypes that are needed for an application as well as the same in reverse. JSON files are automatically converted to their target files for Scribe applications after commits to the main branch, and their opposites can be used to update the JSON files when strings are first changed in the applications.
### Adding Scribe-i18n to Projects [`⇧`](#contents)
To use Scribe-i18n within another repository, run the following command from the root directory of the project to add Scribe-i18n as a subtree:
```bash
git subtree add --prefix <subtree-directory> [email protected]:scribe-org/Scribe-i18n.git main --squash
```
In the command, the value for `subtree-directory` is a directory within the repo structure of the project. Which directory to use will be dependent on the stack of the project and how i18n files will be consumed. Typically, this is the path for a directory named `i18n` that will be created somewhere in the repo structure upon command execution. Refer to documentation of the tool that will consume the i18n files to determine what it should be.
### Pull Requests [`⇧`](#contents)
Good pull requests are the foundation of our community making Scribe-i18n. They should remain focused in scope and avoid containing unrelated commits. Note that all contributions to this project will be made under [the specified license](https://github.com/scribe-org/Scribe-i18n/blob/main/LICENSE.txt).
Expand Down Expand Up @@ -165,7 +188,7 @@ Thank you in advance for your contributions!

# Community [`⇧`](#contents)

### Joining in [``](#contents)
### Joining In [`⇧`](#contents)

After your first few pull requests organization members would be happy to discuss granting you further rights as a contributor, with a maintainer role then being possible after continued interest in the project. Scribe seeks to be an inclusive and supportive organization. We'd love to have you on the team!
Expand Down
Loading

0 comments on commit 5028b34

Please sign in to comment.