0
0
mirror of https://github.com/ankidroid/Anki-Android.git synced 2024-09-19 19:42:17 +02:00
Anki-Android/tools/localization
Mike Hardy 49a7651791
Dependency updates 20240916 (#17071)
* build(deps): `yarn upgrade --latest` in tools/localization

* chore(deps): bump org.jetbrains.kotlinx:kotlinx-coroutines-test

Bumps [org.jetbrains.kotlinx:kotlinx-coroutines-test](https://github.com/Kotlin/kotlinx.coroutines) from 1.8.1 to 1.9.0.
- [Release notes](https://github.com/Kotlin/kotlinx.coroutines/releases)
- [Changelog](https://github.com/Kotlin/kotlinx.coroutines/blob/master/CHANGES.md)
- [Commits](https://github.com/Kotlin/kotlinx.coroutines/compare/1.8.1...1.9.0)

---
updated-dependencies:
- dependency-name: org.jetbrains.kotlinx:kotlinx-coroutines-test
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

* Update Gradle Wrapper from 8.10 to 8.10.1.

Signed-off-by: gradle-update-robot <gradle-update-robot@regolo.cc>

---------

Signed-off-by: gradle-update-robot <gradle-update-robot@regolo.cc>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: gradle-update-robot <gradle-update-robot@regolo.cc>
2024-09-16 07:59:28 -05:00
..
src Dependency updates 20240815 (#16877) 2024-08-15 20:45:59 -05:00
.gitignore upload, build, download and update translations to/from Crowdin using js client api (#11557) 2023-11-24 09:15:45 -05:00
.prettierignore upload, build, download and update translations to/from Crowdin using js client api (#11557) 2023-11-24 09:15:45 -05:00
.prettierrc upload, build, download and update translations to/from Crowdin using js client api (#11557) 2023-11-24 09:15:45 -05:00
eslint.config.mjs Dependency updates 20240815 (#16877) 2024-08-15 20:45:59 -05:00
jest.config.js upload, build, download and update translations to/from Crowdin using js client api (#11557) 2023-11-24 09:15:45 -05:00
package.json Dependency updates 20240916 (#17071) 2024-09-16 07:59:28 -05:00
README.md upload, build, download and update translations to/from Crowdin using js client api (#11557) 2023-11-24 09:15:45 -05:00
tsconfig.json upload, build, download and update translations to/from Crowdin using js client api (#11557) 2023-11-24 09:15:45 -05:00
yarn.lock Dependency updates 20240916 (#17071) 2024-09-16 07:59:28 -05:00

Localization Tool

This project provides a localization tool built with Yarn, built specifically to interact with the crowdin API via their javascript API client

Its purpose is to provide a way to upload our English-language localization files to crowdin so that translators may do their work, and then to download that translation work and faithfully copy it into the non-English Android resource locations.

Getting Started

Follow these steps to set up and run the localization tool.

# Move to the proper directory
cd ./tools/localization
# Install the javascript dependencies
yarn
# Build the project so it is ready to run
yarn build

Commands

The following commands are available. Run them from the ./tools/localization directory:

Upload

Uploads English res/values files to Crowdin.

yarn start upload

Download

Builds and downloads all translations from Crowdin.

yarn start download

Extract

Extracts files from ankidroid.zip into an internal staging area

yarn start extract

Update

Updates the files from the extracted ankidroid.zip file by processing them lightly (adding copyright information, fixing some common errors, etc), then copying them into the correct Android resource folders for the translated languages

yarn start update

Build / Execution Notes

The project is implemented in typescript, which must be transpiled into javascript before it may be executed by the node interpreter.

To transpile the project run:

yarn build

...or alternatively if you are actively developing the project, you may wish to have the code transpiled for testing on any change, this is possible with

yarn dev

...which starts the tsc typescript compiler in --watch mode

After building the project, you may use the package.json run scripts, or the following commands can also be used if you want to execute the transpiled scripts directly:

node .\dist\index.js upload
node .\dist\index.js download
node .\dist\index.js extract
node .\dist\index.js update