-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Get building in Xcode 16.2 * Copy locales settings from ios-pontoon-test * Add exported strings for all locales * Fix nb naming * Move locales to different repo * Run initial import from l10n (cd LocalizationTools &&swift run LocalizationTools --import --project-path ../giellakbd-ios/GiellaKeyboard.xcodeproj --l10n-project-path ../giellakbd-ios/locales) * Split keyboard not supported message into two strings * Consolidate strings into single Localizable.strings These were previously separated by target; one for HostingApp and one for Keyboard. This doesn't play nice with Pontoon and doesn't add much for the added complexity. * Update podfile.lock version * Revert "Consolidate strings into single Localizable.strings" This reverts commit 8575a7b. * I hate that this is the fix for duplicate strings upon export to Pontoon Turns out exporting strings will always add any discovered NSLocalizedStrings in code to the BaseKeyboard lproj, even if those strings are commented out in code, and even if a BaseKeyboard lproj doesn't exist. Since the Localizable.strings file is added to the Keyboard target, this means the export finds these strings twice: once for Keyboard and once for BaseKeyboard. The workaround is to add Localizable.strings to the BaseKeyboard target as well - then it considers the strings to only be a part of Keyboard, which results in no more duplicate strings showing up in Pontoon. * Try again: consolidate strings into single Localizable.strings * Revert "Try again: consolidate strings into single Localizable.strings" This reverts commit c9820c4. * Reapply "Try again: consolidate strings into single Localizable.strings" This reverts commit 52ce46b. * Revert "Get building in Xcode 16.2" This reverts commit 9b4ade2. * Add test workflow * Do push-based sample gh-action instead * First attempt at actual localization imports action * Rename and try a push trigger * Add temp logging * Less verbose * Attempt to fix path, remove logging * Try only committing .lproj strings * Update restore in case we ever need it * Ignore import strings log
- Loading branch information
Showing
24 changed files
with
1,198 additions
and
111 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,86 @@ | ||
name: "Import Localizations" | ||
on: | ||
# schedule: | ||
# - cron: '0 11 * * 1' | ||
push: | ||
workflow_dispatch: | ||
inputs: | ||
branchName: | ||
description: 'Branch used as target for automation' | ||
required: true | ||
default: 'main' | ||
jobs: | ||
build: | ||
runs-on: macos-15 | ||
strategy: | ||
max-parallel: 4 | ||
matrix: | ||
xcode: ["16.2"] | ||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
persist-credentials: false | ||
token: ${{ secrets.GITHUB_TOKEN }} | ||
ref: ${{ github.event.inputs.branchName }} | ||
|
||
- name: Select Xcode ${{ matrix.xcode }} | ||
run: sudo xcode-select -s /Applications/Xcode_${{ matrix.xcode }}.app | ||
|
||
- name: Get PR info | ||
run: | | ||
current_date=$(date +"%Y-%m-%d") | ||
# Use 'main' when triggered via cron | ||
current_branch=${{ github.event.inputs.branchName || 'main' }} | ||
echo "current_date=$current_date" >> $GITHUB_ENV | ||
if [[ $current_branch == 'main' ]]; then | ||
echo "branch_name=string-import-$current_date" >> $GITHUB_ENV | ||
echo "pr_title=Import localizations $current_date" >> $GITHUB_ENV | ||
echo "pr_body=This automated PR imports string changes" >> $GITHUB_ENV | ||
else | ||
# version: v105.0 -> v105 | ||
version=${current_branch%??} | ||
echo "branch_name=string-import-$current_branch-$current_date" >> $GITHUB_ENV | ||
echo "pr_title=[$version]: Import localizations $current_date" >> $GITHUB_ENV | ||
echo "pr_body=This automated PR imports string changes into branch '$current_branch'" >> $GITHUB_ENV | ||
fi | ||
- name: Run script to import strings | ||
run: | | ||
echo "\n\n[*] Cloning required repo to import strings" | ||
if [ -d "LocalizationTools" ] || [ -d "giellakbd-ios-l10n" ]; then | ||
rm -rf LocalizationTools | ||
rm -rf giellakbd-ios-l10n | ||
fi | ||
git clone --depth 1 https://github.com/divvun/LocalizationTools.git || exit 1 | ||
git clone --depth 1 https://github.com/divvun/giellakbd-ios-l10n || exit 1 | ||
echo "\n\n[*] Building tools/Localizations" | ||
(cd LocalizationTools && swift build) | ||
echo "\n\n[*] Importing Strings - takes a minute. (output in import-strings.log)" | ||
(cd LocalizationTools && swift run LocalizationTools \ | ||
--import \ | ||
--project-path "$PWD/../GiellaKeyboard.xcodeproj" \ | ||
--l10n-project-path "$PWD/../giellakbd-ios-l10n") > import-strings.log 2>&1 | ||
echo "\n\n[!] Strings have been imported. You can now create a PR." | ||
echo "\n\n[*] Clean up cloned repos" | ||
rm -rf LocalizationTools | ||
rm -rf giellakbd-ios-l10n | ||
- name: Update new strings | ||
run: |- | ||
git diff || (git add HostingApp/*/*.lproj/* HostingApp/*.lproj/*) | ||
# git restore GiellaKeyboard.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved | ||
- name: Create Pull Request | ||
uses: peter-evans/create-pull-request@v7 | ||
with: | ||
token: ${{ secrets.GITHUB_TOKEN }} | ||
commit-message: ${{ env.pr_title }} | ||
title: "Import Localizations ${{ env.current_date }}" | ||
branch: ${{ env.branch_name }} | ||
body: ${{ env.pr_body }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,3 +7,4 @@ dicts.bundle | |
DerivedData/ | ||
Pods/ | ||
*.xcworkspace/ | ||
import-strings.log |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,39 +1,138 @@ | ||
/* (No Comment) */ | ||
"about" = "Tietoja näppäimistösovelluksesta"; | ||
|
||
/* Spoken by VoiceOver when an element is selected */ | ||
"accessibility.backspace" = "askelpalautin"; | ||
|
||
/* Spoken by VoiceOver when an element is selected */ | ||
"accessibility.moreLetters" = "enemmän: kirjaimia"; | ||
|
||
/* Spoken by VoiceOver when an element is selected */ | ||
"accessibility.moreNumbers" = "enemmän: numeroita"; | ||
|
||
/* Spoken by VoiceOver when an element is selected */ | ||
"accessibility.moreSymbols" = "enemmän: symboleja"; | ||
|
||
/* Spoken by VoiceOver when an element is selected */ | ||
"accessibility.nextKeyboard" = "seuraava näppäimistö"; | ||
|
||
/* Spoken by VoiceOver when an element is selected */ | ||
"accessibility.shift" = "vaihto"; | ||
|
||
/* Spoken by VoiceOver when an element is selected */ | ||
"accessibility.space" = "väli"; | ||
|
||
/* (No Comment) */ | ||
"add" = "Lisää"; | ||
|
||
/* (No Comment) */ | ||
"addNewKeyboard" = "Lisää uusi näppäimistö…"; | ||
|
||
/* (No Comment) */ | ||
"addWord" = "Lisää sana"; | ||
|
||
/* (No Comment) */ | ||
"addWordMessage" = "Tätä sanaa ehdotetaan oikolukubannerissa samankaltaisille syötteille"; | ||
|
||
/* (No Comment) */ | ||
"allowFullAccess" = "Salli kaikki oikeudet"; | ||
|
||
/* (No Comment) */ | ||
"attributions" = "Attribuutiot"; | ||
|
||
/* (No Comment) */ | ||
"block" = "Estä"; | ||
|
||
/* (No Comment) */ | ||
"blocked" = "Estetyt sanat"; | ||
|
||
/* (No Comment) */ | ||
"cancel" = "Peru"; | ||
|
||
/* (No Comment) */ | ||
"contextsFor" = "Kontekstit sanalle \"%1$@\""; | ||
|
||
/* (No Comment) */ | ||
"delete" = "Poista"; | ||
|
||
/* (No Comment) */ | ||
"detected" = "Tunnistetut sanat"; | ||
|
||
/* (No Comment) */ | ||
"downloading" = "Ladataan pakettia \"%1$@\"…"; | ||
|
||
/* (No Comment) */ | ||
"enableKeyboards" = "Enable the keyboards that you want to use."; | ||
|
||
/* (No Comment) */ | ||
"enableTapSoundsPlain" = "Jos haluat näppäinäänet käyttöön, paina nappia %0$@ ja vaihda asetusta %1$@."; | ||
|
||
/* (No Comment) */ | ||
"general" = "General"; | ||
|
||
/* (No Comment) */ | ||
"installingPackages" = "Asennetaan paketteja…"; | ||
|
||
/* (No Comment) */ | ||
"installingSpellers" = "Asennetaan oikaisulukimia…"; | ||
|
||
/* (No Comment) */ | ||
"keyboard" = "Näppäimistö"; | ||
|
||
/* (No Comment) */ | ||
"keyboards" = "Näppäimistöt"; | ||
|
||
/* (No Comment) */ | ||
"language" = "Appikieli"; | ||
|
||
/* (No Comment) */ | ||
"layouts" = "Asetelmat"; | ||
|
||
/* (No Comment) */ | ||
"localeSjd" = "Kiltinänsaame"; | ||
|
||
/* (No Comment) */ | ||
"noUserWords" = "Omia sanoja ei ole vielä."; | ||
|
||
/* (No Comment) */ | ||
"noUserWordsDescription" = "Sanat joita oikoluku ei tunnista ja joita käytetään usein näkyvät täällä."; | ||
|
||
/* (No Comment) */ | ||
"openAppPlain" = "Avaa sovellus %1$@"; | ||
|
||
/* (No Comment) */ | ||
"openSettings" = "Avaa asetukset"; | ||
|
||
/* (No Comment) */ | ||
"save" = "Tallenna"; | ||
"setUp" = "Aseta %1$@"; | ||
"settingUp" = "Asetetaan"; | ||
|
||
/* (No Comment) */ | ||
"settings" = "Asetukset"; | ||
|
||
/* (No Comment) */ | ||
"settingUp" = "Asetetaan"; | ||
|
||
/* (No Comment) */ | ||
"setUp" = "Aseta %1$@"; | ||
|
||
/* (No Comment) */ | ||
"skip" = "Ohita"; | ||
|
||
/* (No Comment) */ | ||
"tapPlain" = "Paina %1$@"; | ||
|
||
/* (No Comment) */ | ||
"unblock" = "Poista estot"; | ||
|
||
/* (No Comment) */ | ||
"userDefined" = "Omat sanat"; | ||
|
||
/* (No Comment) */ | ||
"userDictionary" = "Oma sanakirja"; | ||
|
||
/* (No Comment) */ | ||
"whenYouHaveFinished" = "Palaa takaisin tähän sovellukseen lopetettuasi."; | ||
"word" = "Sana"; | ||
|
||
/* (No Comment) */ | ||
"word" = "Sana"; | ||
|
Oops, something went wrong.