Skip to content

Commit

Permalink
Move fonts into language repo
Browse files Browse the repository at this point in the history
fixed language pack script
added workflow for languages
workflow action version bump
  • Loading branch information
AKuHAK committed May 26, 2022
1 parent 97599cc commit b7f9f98
Show file tree
Hide file tree
Showing 35 changed files with 81 additions and 29 deletions.
65 changes: 54 additions & 11 deletions .github/workflows/compilation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,15 +33,15 @@ jobs:

- name: Upload release artifact ELF
if: ${{ success() }}
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v3
with:
name: OPNPS2LD
path: |
OPNPS2LD-*.ELF
- name: Upload release artifact info
if: ${{ success() }}
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v3
with:
name: INFO
path: |
Expand All @@ -65,7 +65,7 @@ jobs:
run: apk add build-base git zip gawk python3 py3-pip bash

- name: git checkout
uses: actions/checkout@v2
uses: actions/checkout@v3

- run: |
git config --global --add safe.directory "$GITHUB_WORKSPACE"
Expand All @@ -87,11 +87,43 @@ jobs:
run: sh ./make_changelog.sh

- name: Upload variants artifact ELF
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v3
with:
name: OPNPS2LD-VARIANTS
path: OPNPS2LD*.ELF

build-lang:
runs-on: ubuntu-latest
container: ps2dev/ps2dev:latest
steps:
- name: Install dependencies
run: |
apk add build-base git zip gawk python3 py3-pip bash
- name: git checkout
uses: actions/checkout@v3

- run: |
git config --global --add safe.directory "$GITHUB_WORKSPACE"
git fetch --prune --unshallow
- name: Install Python packages
run: pip3 install -r requirements.txt

- name: Compile -> make download_lng languages
run: make --trace download_lng languages

- name: Create artifact
run: sh ./lng_pack.sh

- name: Upload release artifact
if: ${{ success() }}
uses: actions/upload-artifact@v3
with:
name: OPNPS2LD-LANGS
path: |
OPNPS2LD-LANGS-*.zip
build-debug:
strategy:
fail-fast: false
Expand All @@ -104,7 +136,7 @@ jobs:
run: apk add build-base git zip gawk python3 py3-pip bash

- name: git checkout
uses: actions/checkout@v2
uses: actions/checkout@v3

- run: |
git config --global --add safe.directory "$GITHUB_WORKSPACE"
Expand All @@ -123,21 +155,21 @@ jobs:
mv opl.elf opl-${{ matrix.debug }}.elf
- name: Upload variants artifact ELF
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v3
with:
name: opl-debug-${{ steps.version.outputs.version }}-${{ matrix.docker }}
path: opl-*.elf

release:
needs: [build, build-variants]
needs: [build, build-variants, build-lang]
runs-on: ubuntu-latest
if: startsWith(github.ref, 'refs/tags/v') || github.ref == 'refs/heads/master'
env:
USERNAME: ${{ secrets.USERNAME }}
PASSWORD: ${{ secrets.PASSWORD }}
steps:
- name: git checkout
uses: actions/checkout@v2
uses: actions/checkout@v3

- run: git fetch --prune --unshallow

Expand All @@ -146,17 +178,22 @@ jobs:
run: echo "::set-output name=version::$(make oplversion)"

- name: Download release artifact
uses: actions/download-artifact@v1
uses: actions/download-artifact@v3
with:
name: OPNPS2LD

- name: Download variants artifact
uses: actions/download-artifact@v1
uses: actions/download-artifact@v3
with:
name: OPNPS2LD-VARIANTS

- name: Download languages artifact
uses: actions/download-artifact@v3
with:
name: OPNPS2LD-LANGS

- name: Download info artifact
uses: actions/download-artifact@v1
uses: actions/download-artifact@v3
with:
name: INFO

Expand All @@ -166,8 +203,10 @@ jobs:
cp INFO/* OPNPS2LD-VARIANTS/
7z a -t7z OPNPS2LD-${{ steps.version.outputs.version }}.7z OPNPS2LD/*
7z a -t7z OPNPS2LD-VARIANTS-${{ steps.version.outputs.version }}.7z OPNPS2LD-VARIANTS/*
7z a -t7z OPNPS2LD-LANGS-${{ steps.version.outputs.version }}.7z OPNPS2LD-LANGS/*
cp -f OPNPS2LD-${{ steps.version.outputs.version }}.7z OPNPS2LD.7z
cp -f OPNPS2LD-VARIANTS-${{ steps.version.outputs.version }}.7z OPNPS2LD-VARIANTS.7z
cp -f OPNPS2LD-LANGS-${{ steps.version.outputs.version }}.7z OPNPS2LD-LANGS.7z
- name: Create prerelease
if: github.ref == 'refs/heads/master'
Expand All @@ -180,8 +219,10 @@ jobs:
files: |
OPNPS2LD-${{ steps.version.outputs.version }}.7z
OPNPS2LD-VARIANTS-${{ steps.version.outputs.version }}.7z
OPNPS2LD-LANGS-${{ steps.version.outputs.version }}.7z
OPNPS2LD.7z
OPNPS2LD-VARIANTS.7z
OPNPS2LD-LANGS.7z
- name: Create release
if: startsWith(github.ref, 'refs/tags/v')
Expand All @@ -193,8 +234,10 @@ jobs:
files: |
OPNPS2LD-${{ steps.version.outputs.version }}.7z
OPNPS2LD-VARIANTS-${{ steps.version.outputs.version }}.7z
OPNPS2LD-LANGS-${{ steps.version.outputs.version }}.7z
OPNPS2LD.7z
OPNPS2LD-VARIANTS.7z
OPNPS2LD-LANGS.7z
- name: Upload pre-release to Mega
if: github.ref == 'refs/heads/master' && env.USERNAME != null
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -46,3 +46,4 @@ lng/lang_*.lng
*lng_src
src/lang_internal.c
include/lang_autogen.h
tmp/
17 changes: 9 additions & 8 deletions lng/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@

## For translators

All translation files moved to the separate repository: <https://github.com/ps2homebrew/Open-PS2-Loader-lang>\
Provide your submissions there.\
Languages were moved there for reducing commit stress for the main repository.\
All translation files moved to the separate repository: <https://github.com/ps2homebrew/Open-PS2-Loader-lang>\\
Provide your submissions there.\\
Languages were moved there for reducing commit stress for the main repository.\\
Check if your `.yml` file has untranslated strings. Example:

```yml
Expand All @@ -20,16 +20,17 @@ You should change this into:
```
If you want to test your changes:
- run `make download_lng`
- make your changes int `lng_src/*.yml`
- run `make languages`
- test generated file from `lng/lang_*.lng`.

## For developers

If you add the language string into the code,\
propose your changes into `lng_tmpl/_base.yml` with the necessary comments.\
For example, if you add the string `_STR_NETWORK_STARTUP_ERROR`,\
If you add the language string into the code,\\
propose your changes into `lng_tmpl/_base.yml` with the necessary comments.\\
For example, if you add the string `_STR_NETWORK_STARTUP_ERROR`,\\
then you should update the base file like:

```yml
Expand All @@ -38,8 +39,8 @@ then you should update the base file like:
string: '%d: Network startup error.'
```

After running `make languages` propose your changes into [the language repo](https://github.com/ps2homebrew/Open-PS2-Loader-lang).\
After running `make languages` propose your changes into [the language repo](https://github.com/ps2homebrew/Open-PS2-Loader-lang).\\
Folder `lng_src` will contain updated files.

It is not recommended to rename or remove already existing strings.\
It is not recommended to rename or remove already existing strings.\\
In such a case, you will need to edit all language yml files manually.
27 changes: 17 additions & 10 deletions lng_pack.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,10 @@
# Reworked by Doctor Q <[email protected]>

# Set variables
DATE=$(date +'%d %B %Y')
CURRENT_DIR=$(pwd)
BUILD_DIR="/tmp/OPL_LANG"
LANG_LIST="/tmp/OPL_LANG_LIST"
BUILD_DIR="$(pwd)/tmp/OPL_LANG"
LANG_LIST="$(pwd)/tmp/OPL_LANG_LIST"
make oplversion 2>/dev/null
if [ $? == "0" ]
then
Expand All @@ -25,16 +26,22 @@ else
fi

# Print a list
printf "$(ls ${CURRENT_DIR}/lng/ | cut -c 6- | rev | cut -c 5- | rev)" > "${LANG_LIST}"
mkdir -p "${BUILD_DIR}"
cd "${CURRENT_DIR}/lng/"
printf "$(ls ./*.lng | cut -c 6- | rev | cut -c 5- | rev)" > "${LANG_LIST}"
cd "${CURRENT_DIR}"

# Copy format
while IFS= read -r CURRENT_FILE
do
mkdir -p "${BUILD_DIR}/${CURRENT_FILE}-${OPL_VERSION}/"
cp "${CURRENT_DIR}/lng/lang_${CURRENT_FILE}.lng" "${BUILD_DIR}/${CURRENT_FILE}-${OPL_VERSION}/lang_${CURRENT_FILE}.lng"
if [ -e "thirdparty/font_${CURRENT_FILE}.ttf" ]
if [ -e "lng_src/thirdparty/font_${CURRENT_FILE}.ttf" ]
then
cp "${CURRENT_DIR}/lng_src/thirdparty/font_${CURRENT_FILE}.ttf" "${BUILD_DIR}/${CURRENT_FILE}-${OPL_VERSION}/font_${CURRENT_FILE}.ttf"
elif [ -e "lng_src/thirdparty/font_${CURRENT_FILE}.otf" ]
then
cp "${CURRENT_DIR}/thirdparty/font_${CURRENT_FILE}.ttf" "${BUILD_DIR}/${CURRENT_FILE}-${OPL_VERSION}/font_${CURRENT_FILE}.ttf"
cp "${CURRENT_DIR}/lng_src/thirdparty/font_${CURRENT_FILE}.otf" "${BUILD_DIR}/${CURRENT_FILE}-${OPL_VERSION}/font_${CURRENT_FILE}.otf"
fi
done < ${LANG_LIST}

Expand All @@ -47,11 +54,11 @@ done < ${LANG_LIST}
-----------------------------------------------------------------------------
Open PS2 Loader Official Translations (25 August 2016)
Open PS2 Loader Official Translations (${DATE})
HOW TO INSTALL:
1. make sure you are running latest OPL
2. transfer both the the LANGUAGE FILE (.lng) and the FONT FILE (.ttf) into your OPL directory of your memory card
2. transfer both the the LANGUAGE FILE (.lng) and the FONT FILE (.ttf/.otf) into your OPL directory of your memory card
a. IMPORTANT: Do not rename the files
b. NOTE: Some languages don't require a FONT file, so it won't be included
3. run OPL
Expand All @@ -65,9 +72,9 @@ EOF
# Lets pack it!
cd ${BUILD_DIR}/
zip -r "${CURRENT_DIR}/OPNPS2LD_LANGS-${OPL_VERSION}.zip" ./*
if [ -f "${CURRENT_DIR}/OPNPS2LD_LANGS-${OPL_VERSION}.zip" ]
then echo "OPL Lang Package Complete: OPNPS2LD_LANGS-${OPL_VERSION}.zip"
zip -r "${CURRENT_DIR}/OPNPS2LD-LANGS-${OPL_VERSION}.zip" ./*
if [ -f "${CURRENT_DIR}/OPNPS2LD-LANGS-${OPL_VERSION}.zip" ]
then echo "OPL Lang Package Complete: OPNPS2LD-LANGS-${OPL_VERSION}.zip"
else echo "OPL Lang Package not found!"
fi
Expand Down
Binary file removed thirdparty/font_Arabic.ttf
Binary file not shown.
Binary file removed thirdparty/font_Bulgarian.ttf
Binary file not shown.
Binary file removed thirdparty/font_Croatian.ttf
Binary file not shown.
Binary file removed thirdparty/font_Czech.ttf
Binary file not shown.
Binary file removed thirdparty/font_Danish.ttf
Binary file not shown.
Binary file removed thirdparty/font_Dutch.ttf
Binary file not shown.
Binary file removed thirdparty/font_Filipino.ttf
Binary file not shown.
Binary file removed thirdparty/font_French.ttf
Binary file not shown.
Binary file removed thirdparty/font_German.ttf
Binary file not shown.
Binary file removed thirdparty/font_Greek.ttf
Binary file not shown.
Binary file removed thirdparty/font_Hebrew.ttf
Binary file not shown.
Binary file removed thirdparty/font_Hungarian.ttf
Binary file not shown.
Binary file removed thirdparty/font_Indonesian.ttf
Binary file not shown.
Binary file removed thirdparty/font_Italian.ttf
Binary file not shown.
Binary file removed thirdparty/font_Japanese.otf
Binary file not shown.
Binary file removed thirdparty/font_Korean.ttf
Binary file not shown.
Binary file removed thirdparty/font_Laotian.ttf
Binary file not shown.
Binary file removed thirdparty/font_Norvegian.ttf
Binary file not shown.
Binary file removed thirdparty/font_Persian.ttf
Binary file not shown.
Binary file removed thirdparty/font_Polish.ttf
Binary file not shown.
Binary file removed thirdparty/font_Portuguese.ttf
Binary file not shown.
Binary file removed thirdparty/font_Portuguese_BR.ttf
Binary file not shown.
Binary file removed thirdparty/font_Romana.otf
Binary file not shown.
Binary file removed thirdparty/font_Russian.ttf
Binary file not shown.
Binary file removed thirdparty/font_SChinese.ttf
Binary file not shown.
Binary file removed thirdparty/font_Spanish.ttf
Binary file not shown.
Binary file removed thirdparty/font_Swedish.ttf
Binary file not shown.
Binary file removed thirdparty/font_TChinese.ttf
Binary file not shown.
Binary file removed thirdparty/font_Thai.ttf
Binary file not shown.
Binary file removed thirdparty/font_Turkish.ttf
Binary file not shown.
Binary file removed thirdparty/font_Vietnamese.ttf
Binary file not shown.

0 comments on commit b7f9f98

Please sign in to comment.