|
| 1 | +## Manual Localization Instructions |
| 2 | + |
| 3 | +> This is work-in-progress. There are some open questions on how to deal with certain strings. |
| 4 | +
|
| 5 | +There are several scripts to automate the localization process. However, these localization scripts require access to tokens: |
| 6 | + |
| 7 | +* export_localizations.sh |
| 8 | +* import_localizations.sh |
| 9 | + |
| 10 | +If access to these tokens is not available, but a user is a manager for the Loop project at lokalise, they can manually take those actions. |
| 11 | + |
| 12 | +New scripts were created to provide a step-by-step manual process: |
| 13 | + |
| 14 | +* manual_export_localizations.sh |
| 15 | +* manual_import_localizations.sh |
| 16 | +* manual_review_translations.sh |
| 17 | +* manual_translations_finalize.sh |
| 18 | + |
| 19 | +The summary action for these script is provided here, with details in the [Usage](#usage) section. |
| 20 | + |
| 21 | +#### manual_export_localizations |
| 22 | + |
| 23 | +* script to create xliff_out folder with xliff files in all languages suitable to drag and drop into lokalise |
| 24 | + |
| 25 | +#### manual_import_localizations |
| 26 | + |
| 27 | +* script to import from xliff_in folder |
| 28 | + * create `translations` branch for each project |
| 29 | + * command-line Xcode build before importing xliff files |
| 30 | + * command-line Xcode build for each language importing from the associated xliff file |
| 31 | + * after completion, LoopWorkspace has uncommitted changes in projects |
| 32 | + |
| 33 | +#### manual_review_translations |
| 34 | + |
| 35 | +* script to make it easy to review changes per submodule, shows diffs, and pause so manual modifications can be enacted if appropriate |
| 36 | + |
| 37 | +#### manual_translations_finalize |
| 38 | + |
| 39 | +* script to commit the change for each project folder (submodule) |
| 40 | + * if there are no changes, no action is taken |
| 41 | + * if there are changes |
| 42 | + * git add .; commit all with automated message |
| 43 | + * push the `translations` branch to origin |
| 44 | + * create a PR from `translations` branch to default branch for that repository |
| 45 | + * open the URL for the PR |
| 46 | + |
| 47 | +## Usage |
| 48 | + |
| 49 | +### Loop Dashboard at localise |
| 50 | + |
| 51 | +When you log into the [lokalise portal](https://app.lokalise.com/projects) navigate to the Loop dashboard, you see all the languages and the % complete for translation. |
| 52 | + |
| 53 | +#### Open questions |
| 54 | + |
| 55 | +> Notes from Marion Barker: |
| 56 | +
|
| 57 | +##### Question 1: |
| 58 | + |
| 59 | +I do not believe these keys should be included in the translation process: |
| 60 | + |
| 61 | +* CFBundleGetInfoString |
| 62 | +* CFBundleNames |
| 63 | +* NSHumanReadableCopyright |
| 64 | + |
| 65 | +These were almost all empty. I deleted these keys on 2025-07-27 on the lokalise site. |
| 66 | + |
| 67 | +A few of them did have entries for some languages |
| 68 | + |
| 69 | +* I have them archived locally and can restore them if they should have been kept |
| 70 | + |
| 71 | +When uploading a new set of xliff_out files, they are recreated - so I think I'm missing a method to limit them. |
| 72 | + |
| 73 | +Note that in the xliff files, these say translate="no", so why do they show up in the imported list on lokalise? |
| 74 | + |
| 75 | +I will keep looking for help in the documentation, but if anyone knows - let me know. |
| 76 | + |
| 77 | +Because of this uncertainty, I only modified the LibreTransmitter project so far because there is a hotfix needed for it. |
| 78 | + |
| 79 | +##### Question 2: |
| 80 | + |
| 81 | +A lot of the changes that were proposed were white space changes. |
| 82 | + |
| 83 | +Here's an example: |
| 84 | + |
| 85 | +``` |
| 86 | +diff --git a/RileyLinkKitUI/nb.lproj/Localizable.strings b/RileyLinkKitUI/nb.lproj/Localizable.strings |
| 87 | +index fbfc31e..db53cbd 100644 |
| 88 | +--- a/RileyLinkKitUI/nb.lproj/Localizable.strings |
| 89 | ++++ b/RileyLinkKitUI/nb.lproj/Localizable.strings |
| 90 | +@@ -74,7 +74,7 @@ |
| 91 | + "Name" = "Navn"; |
| 92 | + |
| 93 | + /* Detail text when battery alert disabled. |
| 94 | +- Text indicating LED Mode is off */ |
| 95 | ++Text indicating LED Mode is off */ |
| 96 | + "Off" = "Av"; |
| 97 | + |
| 98 | + /* Text indicating LED Mode is on */ |
| 99 | +@@ -87,7 +87,7 @@ |
| 100 | + "Signal Strength" = "Signalstyrke"; |
| 101 | + |
| 102 | + /* The title of the section for orangelink commands |
| 103 | +- The title of the section for rileylink commands */ |
| 104 | ++The title of the section for rileylink commands */ |
| 105 | + "Test Commands" = "Testkommandoer"; |
| 106 | + |
| 107 | + /* The title of the cell showing Test Vibration */ |
| 108 | +``` |
| 109 | + |
| 110 | +I see no point in committing this kind of a change. There are other substantive changes in other projects, but there is so much noise from the white space changes, I would like to modify this so only translation updates are included. |
| 111 | + |
| 112 | +##### Question 3: |
| 113 | + |
| 114 | +Both OmniBLE and OmniKit seem to be adding new xx.lproj folders at the top level with the languages already being present in other folders. These have associated changes to the `pbxproj` file. I'm confused by this and wonder if this is something else that should be fixed. |
| 115 | + |
| 116 | +### Export from LoopWorkspace |
| 117 | + |
| 118 | +This section is used to update the strings in lokalise for translation. |
| 119 | + |
| 120 | +First navigate to the LoopWorkspace directory in the appropriate branch. Make sure it is fully up to date with GitHub. Make sure the scripts are executable. You may need to apply `chmod +x` to the scripts. |
| 121 | + |
| 122 | +Make sure the Xcode workspace is **not** open on your Mac or this will fail. |
| 123 | + |
| 124 | +``` |
| 125 | +./Scripts/manual_export_localizations.sh |
| 126 | +``` |
| 127 | + |
| 128 | +This creates an xliff_out folder filled with xliff files, one for each language, that contains all the keys and strings for the entire clone (including all submodules). |
| 129 | + |
| 130 | + |
| 131 | +### Import into lokalise |
| 132 | + |
| 133 | +This section requires the user have `manager` access to the Loop project. |
| 134 | + |
| 135 | +Log into the [lokalise portal](https://app.lokalise.com/projects) and navigate to Loop. |
| 136 | + |
| 137 | +Select [Upload](https://app.lokalise.com/upload/414338966417c70d7055e2.75119857/) |
| 138 | + |
| 139 | +Drag the *.xliff files into the drag and drop location. |
| 140 | + |
| 141 | +Be patient |
| 142 | + |
| 143 | +* while each language is uploaded, the `uploading` indicator shows up under each language on the left side |
| 144 | +* at the bottom of the list, the `Import Files` should be available when all have completed uploading |
| 145 | + * Tap on `Import Files` |
| 146 | +* progress will show at upper right |
| 147 | + |
| 148 | +When this is done, check the Loop lokalise dashboard again to see updated statistics. |
| 149 | + |
| 150 | + |
| 151 | +### Translations |
| 152 | + |
| 153 | +The translations are performed by volunteers. To volunteer, join [Loop zulipchat]() and send a direct message to Marion Barker with your email address and the language(s) you can translate. |
| 154 | + |
| 155 | +### Export from lokalise |
| 156 | + |
| 157 | +This section requires the user have `manager` access to the Loop project. |
| 158 | + |
| 159 | +Log into the [lokalise portal](https://app.lokalise.com/projects) and navigate to Loop. |
| 160 | + |
| 161 | +Select [Download](https://app.lokalise.com/download/414338966417c70d7055e2.75119857/) |
| 162 | + |
| 163 | +* The default settings were adjusted to match those of the original script (import_localizations.sh) |
| 164 | +* Click on the `Build and download` button at either the bottom of the screen or the top left |
| 165 | + |
| 166 | + |
| 167 | +### Import into LoopWorkspace |
| 168 | + |
| 169 | +When the download from lokalise completes, navigate to your ~/Download folder in finder: |
| 170 | + |
| 171 | +* rename `Loop-Localizable.zip` to `xliff_in.zip` |
| 172 | +* uncompress to create the xliff_in folder |
| 173 | +* move the xliff_in folder to the top level of the LoopWorkspace folder |
| 174 | + |
| 175 | +The default branch name used for all the submodules is `translations`. If you want to modify that, edit the script and change `translation_dir` before executing the script. |
| 176 | + |
| 177 | +Confirm the list of `projects` in the script is up to date regarding owner, repository name, repository branch. |
| 178 | + |
| 179 | +Execute this script: |
| 180 | + |
| 181 | +``` |
| 182 | +./Scripts/manual_import_localizations.sh |
| 183 | +``` |
| 184 | + |
| 185 | +### Commit Changes and Create PRs |
| 186 | + |
| 187 | +Examine the diffs for each submodule to make sure they are appropriate. |
| 188 | + |
| 189 | +There are some changes that are primarily white space, so I did not commit those. |
| 190 | + |
| 191 | +See section on [Open questions](#open-questions). |
| 192 | + |
| 193 | +Status on 2025-07-28: |
| 194 | + |
| 195 | +* Previously LibreTransmitter translations were updated manually and that PR committed |
| 196 | +* A hotfix is needed for LibreTransmitter to support European Libre 2 transmitters and it is ready to go |
| 197 | +* A PR is merged to G7SensorKit that can be added along with the hotfix |
| 198 | + |
| 199 | +Decided: |
| 200 | + |
| 201 | +* Hotfix will include these prototype scripts and the modification listed above. |
| 202 | +* Work will continue on the methodology to capture translations and bring them into Loop in the near future |
| 203 | +* This instruction file will be updated as the learning process continues |
| 204 | + |
| 205 | +### Utility Scripts |
| 206 | + |
| 207 | +If you need to start over but don't want to lose prior work, edit this script for name of the branch to archive the translations and execute it. |
| 208 | + |
| 209 | +* archive_translations.sh |
| 210 | + * internal names that can be edited: |
| 211 | + * archive_dir="test_translations" |
| 212 | + * translation_dir="translations" |
| 213 | + |
| 214 | + |
| 215 | + |
| 216 | + |
0 commit comments