Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
…-l10n into new
  • Loading branch information
GarboMuffin committed Jan 24, 2024
2 parents a13720b + f1f0b25 commit 3af821d
Show file tree
Hide file tree
Showing 21 changed files with 11,171 additions and 1,514 deletions.
1 change: 1 addition & 0 deletions .husky/.gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
* text eol=lf
4 changes: 4 additions & 0 deletions .husky/commit-msg
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/usr/bin/env sh
. "$(dirname -- "$0")/_/husky.sh"

npx --no-install commitlint --edit "$1"
55 changes: 55 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
# Changelog

All notable changes to this project will be documented in this file. See
[Conventional Commits](https://conventionalcommits.org) for commit guidelines.

# [3.18.0](https://github.com/scratchfoundation/scratch-l10n/compare/v3.17.0...v3.18.0) (2024-01-16)


### Features

* realign version numbers ([c4f9f06](https://github.com/scratchfoundation/scratch-l10n/commit/c4f9f06744c13c97032986360faffba953ff8538))

# 1.0.0 (2024-01-16)


### Bug Fixes

* add missing stdout ([113c0c0](https://github.com/scratchfoundation/scratch-l10n/commit/113c0c095e1e7a4a6f8a678d11d67f35221b23ca))
* **deps:** update babel monorepo ([0ec47c2](https://github.com/scratchfoundation/scratch-l10n/commit/0ec47c2d6f35b35b38f9267ae14f4821886a20c5))
* **deps:** update babel monorepo to v7.23.7 ([172691f](https://github.com/scratchfoundation/scratch-l10n/commit/172691f13359cb093fadd5ebeaa8e8cdc10f1078))
* **deps:** update dependency @transifex/api to v4.3.0 ([8787503](https://github.com/scratchfoundation/scratch-l10n/commit/8787503122f934d554ce548ed97e3c6271906056))
* fetch languages and correctly get language code in txAvailableLanguages ([a3eed89](https://github.com/scratchfoundation/scratch-l10n/commit/a3eed8987b5cb4b840dff3a5b463f9f8f76b61e6))
* fix some errors with validation and error output ([bc151d5](https://github.com/scratchfoundation/scratch-l10n/commit/bc151d5ef8ed6b356e6e33dbd89e081a815e42aa))
* remove unnecessary if statement ([34fcab3](https://github.com/scratchfoundation/scratch-l10n/commit/34fcab3ce0247834d168bda08492a71367924e8c))
* **scripts:** add retries, correct formatting for editor ([137b6e3](https://github.com/scratchfoundation/scratch-l10n/commit/137b6e3d09e6d383213f22acc110aef217871d42))
* use correct name for Filipino ([2634e78](https://github.com/scratchfoundation/scratch-l10n/commit/2634e788064bd616c9eb6c8c999dc226f3d8199c))
* use correct return type for async functions ([beda44e](https://github.com/scratchfoundation/scratch-l10n/commit/beda44ed7b9062342286552c27436e0ae9b87bf1))
* use es6 in eslint to avoid disabling linting on some lines ([b67ea68](https://github.com/scratchfoundation/scratch-l10n/commit/b67ea684e74289b424da9a3b7114dd395fca2dff))
* use stdout instead of console ([f298a58](https://github.com/scratchfoundation/scratch-l10n/commit/f298a58aeba7718fb13c636dcff3e6ac6bc979ce))
* use tidier import for transifex imports ([d6f1224](https://github.com/scratchfoundation/scratch-l10n/commit/d6f1224931e5c71c3b8b6a8ee7712f28d75efe0c))


* Add scratch-paint ([0cb13cb](https://github.com/scratchfoundation/scratch-l10n/commit/0cb13cbaee11c9ba32269730d92224b3caeedba3))


### Features

* add asturian language ([01e29ea](https://github.com/scratchfoundation/scratch-l10n/commit/01e29ea229d1401f01b5430836003a011dcba64a))
* add esperanto language ([af35fe0](https://github.com/scratchfoundation/scratch-l10n/commit/af35fe0dbe51b1d3ef1d916bab5b53d047dc76e0))
* add filipino translations ([ccae0fc](https://github.com/scratchfoundation/scratch-l10n/commit/ccae0fc838d2e1b0a2642bc356bea799c423017d))
* add hausa language ([b6f145b](https://github.com/scratchfoundation/scratch-l10n/commit/b6f145bb94c1b0def0e8ae965565bab12befc0ea))
* add hindi ([74f5560](https://github.com/scratchfoundation/scratch-l10n/commit/74f556088822f4c64071623c0c9a8142361d05ef))
* add occitan language ([8b1d255](https://github.com/scratchfoundation/scratch-l10n/commit/8b1d25597fcc4700e0420e0f2ea250cce2691edc))
* mark automated Transifex updates as fixes ([94c3353](https://github.com/scratchfoundation/scratch-l10n/commit/94c3353f541403e8c4ecfb635684fc639562e3d0))
* migrate help utils to v3 api ([db7a2a4](https://github.com/scratchfoundation/scratch-l10n/commit/db7a2a4ca0e5fb55e097752a66087932a64c492e))
* migrate push help script ([2907601](https://github.com/scratchfoundation/scratch-l10n/commit/2907601077cfa890984f905e0c591be42d3c0280))


### BREAKING CHANGES

* - bumped major version to 2.

Restructured to support multiple components. Package default is just localeData for currently supported locales including the name for each language.

messages for each component are exported as separate files in locales. Clients of l10n will need to import messages for each of the compents used and combine them.
32 changes: 18 additions & 14 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,36 +29,40 @@ Transifex API token can either be stored in the `TX_TOKEN` environment variable
<!--
Translation of all Scratch projects is managed on the Transifex service: https://www.transifex.com/llk/public
This repository collects translations submitted to the Scratch projects on Transifex. **Please do not submit PRs. If you would like to contribute translations, please sign up to translate on Transifex.**
This repository collects translations submitted to the Scratch projects on Transifex. **Please do not submit PRs. If
you would like to contribute translations, please sign up to translate on Transifex.**
## Using scratch-l10n in development
#### Installation
```bash
npm install --save-dev scratch-l10n
```
### Basic Use
#### Basic Use
```js
import locales, {localeData, isRtl} from 'scratch-l10n';
import editorMessages from 'scratch-l10n/locales/editor-messages';
```
* `locales`: currently supported locales for the Scratch project
* `isRtl`: function that returns true if the locale is one that is written right-to-left
* `localeData`: locale data for the supported locales, in the format accepted by `addLocaleData` required by `react-intl`
* `editorMessages`: the actual message strings for all supported locales for a particular resource. `editorMessages` collects all the strings for the interface, extensions and paint-editor.
* `editorMessages`: the actual message strings for all supported locales for a particular resource. `editorMessages`
collects all the strings for the interface, extensions and paint-editor.
### Useful Scripts
#### Useful Scripts
scratch-l10n provides:
* `build-i18n-src`: script that uses babel and plugins to extract all `FormattedMessage` strings for translation. Combines the message from all the source files into one `en.json`
* `tx-push-src`: script to push the `en.json` file to Transifex. Requires that the environment variable `TX_TOKEN` is set with a value that has developer access to the Scratch projects on Transifex (i.e. Scratch Team only)
#### Versioning
scratch-l10n uses semantic versioning - breaking changes will increment the major version number, and new features (e.g. a new language) will increment the minor version number. However, the patch number is actually a datetime string. That way it's easy to see how recently the translations were updated.
* `build-i18n-src`: script that uses babel and plugins to extract all `FormattedMessage` strings for translation.
Combines the message from all the source files into one `en.json`
* `tx-push-src`: script to push the `en.json` file to Transifex. Requires that the environment variable `TX_TOKEN` is
set with a value that has developer access to the Scratch projects on Transifex (i.e. Scratch Team only)
### Versioning
In general, changes that require a PR (new functionality, new language) should increment the minor version. Pulling new translations from Transifex is automated and will commit to master directly.
`scratch-l10n` uses semantic versioning - breaking changes will increment the major version number, and new features
(e.g. a new language) will increment the minor version number. Pulling new translations from Transifex is automated
and will increase the patch version.
#### Deprecations
### Deprecations
We are moving away from using the `tx` cli, so the `.tx/config` file will eventually be deprecated.
-->
4 changes: 4 additions & 0 deletions commitlint.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
module.exports = {
extends: ['@commitlint/config-conventional'],
ignores: [message => message.startsWith('chore(release):')]
};
Loading

0 comments on commit 3af821d

Please sign in to comment.