diff --git a/.gitmodules b/.gitmodules index 1308e60c03..5a920d9586 100644 --- a/.gitmodules +++ b/.gitmodules @@ -58,3 +58,12 @@ [submodule "LibreTransmitter"] path = LibreTransmitter url = https://github.com/LoopKit/LibreTransmitter.git +[submodule "EversenseKit"] + path = EversenseKit + url = https://github.com/bastiaanv/EversenseKit +[submodule "MedtrumKit"] + path = MedtrumKit + url = https://github.com/jbr7rr/MedtrumKit.git +[submodule "DanaKit"] + path = DanaKit + url = https://github.com/bastiaanv/DanaKit diff --git a/DanaKit b/DanaKit new file mode 160000 index 0000000000..c544c42b58 --- /dev/null +++ b/DanaKit @@ -0,0 +1 @@ +Subproject commit c544c42b58e436e85046dd701bbe4a47ba16593b diff --git a/EversenseKit b/EversenseKit new file mode 160000 index 0000000000..fe322a62f4 --- /dev/null +++ b/EversenseKit @@ -0,0 +1 @@ +Subproject commit fe322a62f49cd4e7ee5f651dc43c70c5c2e87f07 diff --git a/LoopWorkspace.xcworkspace/contents.xcworkspacedata b/LoopWorkspace.xcworkspace/contents.xcworkspacedata index a870f8b7c9..b042792973 100644 --- a/LoopWorkspace.xcworkspace/contents.xcworkspacedata +++ b/LoopWorkspace.xcworkspace/contents.xcworkspacedata @@ -108,12 +108,18 @@ + + + + @@ -132,4 +138,7 @@ + + diff --git a/LoopWorkspace.xcworkspace/xcshareddata/swiftpm/Package.resolved b/LoopWorkspace.xcworkspace/xcshareddata/swiftpm/Package.resolved index 85b387d04a..c9b09d9601 100644 --- a/LoopWorkspace.xcworkspace/xcshareddata/swiftpm/Package.resolved +++ b/LoopWorkspace.xcworkspace/xcshareddata/swiftpm/Package.resolved @@ -1,5 +1,5 @@ { - "originHash" : "7645108625333b4ec60e0e439db0c0dc8a91ad0942d36797c6b66208a9082ea2", + "originHash" : "23b19e660bb8e19ecae2e1186b6d2d4c2b64d16171c7a1658e596c8af3b90873", "pins" : [ { "identity" : "amplitude-ios", diff --git a/LoopWorkspace.xcworkspace/xcshareddata/xcschemes/LoopWorkspace.xcscheme b/LoopWorkspace.xcworkspace/xcshareddata/xcschemes/LoopWorkspace.xcscheme index e09bc55654..eb4fbe86ba 100644 --- a/LoopWorkspace.xcworkspace/xcshareddata/xcschemes/LoopWorkspace.xcscheme +++ b/LoopWorkspace.xcworkspace/xcshareddata/xcschemes/LoopWorkspace.xcscheme @@ -146,6 +146,20 @@ ReferencedContainer = "container:MinimedKit/MinimedKit.xcodeproj"> + + + + + + + + + + + + + + + + As of 18 Feb 2026, the translations for these repositories are added to lokalise +> * DanaKit +> * EversenseKit +> * MedtrumKit + +> In order to manage those localization strings, the translation work will be done in the feat/eversense branch, which includes those 3 repositories. + +> The Scripts needed to handle these new repositories are found on in this branch (for now). + Translations for Loop are performed by volunteers at [lokalise](https://app.lokalise.com/projects). Several scripts were added to assist in bringing those translations into the repositories and updating keys when strings are added or modified. @@ -305,6 +315,42 @@ The define_common.sh is used by other scripts to provide a single source for the If you need to start over but don't want to lose prior work, use archive_translations.sh. However, this is probably no longer necessary with the optional arguments available with the manual scripts. +### Additional Utility Scripts + +These scripts are used for several purposes but are not part of the Localization process. + +They are documented here for convenience. The alphabetic list is provided here. + +* open_selected_url.sh +* reconfigure_remotes.sh +* update_loopandlearn_forks.sh +* update_submodule_refs.sh + +#### update_submodules_refs + +This is used to checkout the most recent branch for each submodule in the workspace. It is used as a final step after the translation is completed but also is used to bring in other updates from the submodules into the workspace. + +After running this script, use `git status` to determine which submodules were updated so the modifications can be tested and committed. + +#### reconfigure_remotes + +This is a helper script for a LoopWorkspace clone for use when the .gitmodules path name changes for any reason, and the local clone needs to be updated. + +This change was made because (2026 April 30) the translation work for feature branches and the submodule update work were using different paths and it was just too confusing and error prone. By using the upstream fork in .gitmodules and in the translations scripts, life is simpler. + +* The path for DanaKit, EversenseKit and MedtrumKit was changed from loopandlearn to the respective upstream repositories +* If a local clone has any submodules pointing to loopandlearn as the remote named `origin`, run this script to update it + +There is no harm running the script even if all submodules are properly configured. + +### Trio Utility Scripts + +These are Trio support utilities run within a LoopWorkspace clone to sync the loopandlearn forks for use with Trio. They require appropriate permissions. + +We support Trio with some of the submodules. To enable Trio to use a slightly modified version of the repositories, Trio uses loopandlearn, not the upstream repos in their `.gitmodule` list. In order to keep the loopandlearn forks up to date, the `update_loopandlearn_forks.sh` automatically updates all the submodules used by Trio so that loopandlearn forks match the upstream forks for the appropriate branches. + +When there are submodules where Trio uses a slightly different version of code, a `trio` branch is created. In that case, the update is done manually. To assist in the process, the script `open_selected_url.sh` is called from within the `update_loopandlearn_forks.sh` script. + ## Questions and notes Most of the questions were worked through while developing the new scripts. diff --git a/Scripts/define_common.sh b/Scripts/define_common.sh index 0c75a998e0..7f64ea78fb 100755 --- a/Scripts/define_common.sh +++ b/Scripts/define_common.sh @@ -34,7 +34,6 @@ MESSAGE_FILE="xlate_message_file.txt" # matches lokalise order, en plus alphabetical order by language name in English LANGUAGES=(en \ ar \ - ce \ zh-Hans \ cs \ da \ @@ -43,10 +42,10 @@ LANGUAGES=(en \ fr \ de \ he \ - hi \ hu \ it \ ja \ + ko \ nb \ pl \ pt-BR \ @@ -79,6 +78,9 @@ PROJECTS=( \ LoopKit:OmniKit:main \ LoopKit:RileyLinkKit:dev \ LoopKit:TidepoolService:dev \ + bastiaanv:DanaKit:dev \ + bastiaanv:EversenseKit:dev \ + jbr7rr:MedtrumKit:dev \ ) function section_divider() { diff --git a/Scripts/open_selected_url.sh b/Scripts/open_selected_url.sh new file mode 100755 index 0000000000..84e668b99a --- /dev/null +++ b/Scripts/open_selected_url.sh @@ -0,0 +1,43 @@ +#!/bin/zsh + +# The purpose of this script is to open forks on GitHub in browser that require manual evaluation. + +source Scripts/define_common.sh + +section_divider +echo "You are running ${0}" +echo +echo " This automatically opens forks that need to be manually managed in your browser so you" +echo " can handle the process at GitHub." + +# At the moment, LoopKit/LoopKit has commits used by Trio that require manual sync +# so it is added to the SPECIAL_PROJECT_FORKS list. (This is here for convenience.) +# +# Later - if Trio needs a different version than Loop for some of the repositories, +# additional trio branches will be created and added to this script +DOWNSTREAM_GITHUB_NAME="loopandlearn" + +SPECIAL_PROJECT_FORKS=( \ + loopandlearn:LoopKit:dev:trio \ +) + +section_divider +echo " ////////////// Use Browser for next step ////////////" +echo +echo " Manually update these downstream repositories at ${DOWNSTREAM_GITHUB_NAME}" +echo " Each URL will automatically open" +echo +for project in ${SPECIAL_PROJECT_FORKS}; do + IFS=":" read user dir branch downstream_branch <<< "$project" + echo " Manually sync ${DOWNSTREAM_GITHUB_NAME}/$dir:$downstream_branch with $user/$dir:$branch" + open https://github.com/${DOWNSTREAM_GITHUB_NAME}/$dir/tree/$downstream_branch +done + +section_divider +echo " ////////////// WARNING ////////////" +echo +echo " If any updates were made by manual sync at GitHub," +echo " follow up by running:" +echo " ./Scripts/update_submodule_refs.sh" +echo " This ensures the submodules used in your local clone are up to date" +section_divider diff --git a/Scripts/reconfigure_remotes.sh b/Scripts/reconfigure_remotes.sh new file mode 100755 index 0000000000..2722e37133 --- /dev/null +++ b/Scripts/reconfigure_remotes.sh @@ -0,0 +1,43 @@ +#!/bin/zsh + +source Scripts/define_common.sh + +section_divider +echo "You are running ${0}" +echo +echo " This modifies your local clone if necessary." +echo " No change happens if your local clone is already configured." +echo "" +echo " Scripts need to have the remote named origin point to" +echo " the correct upstream repository." +echo "" +echo " It is meant to be run once per local clone" +echo " following a change in upstream paths for .gitmodules" +echo + +continue_or_quit ${0} + +# This ensures the remote named origin for each submodule matches +# the PROJECTS array upstream repo +for project in ${PROJECTS}; do + echo + echo "Row: $project" + IFS=":" read user dir branch <<< "$project" + echo "Checking configuration for $branch on $user/$dir" + cd $dir + git checkout $branch + current_remote=$(git remote get-url origin 2>/dev/null) + expected_remote="https://github.com/$user/$dir.git" + if [[ "${current_remote%.git}" != "${expected_remote%.git}" ]]; then + echo " Updating origin: $current_remote -> $expected_remote" + git remote remove origin + git remote add origin "$expected_remote" + git fetch origin + git branch --set-upstream-to=origin/$branch $branch + else + echo " Origin is correct: $current_remote" + fi + git branch --set-upstream-to=origin/$branch $branch + git pull + cd - +done diff --git a/Scripts/update_loopandlearn_forks.sh b/Scripts/update_loopandlearn_forks.sh new file mode 100755 index 0000000000..a102e3d205 --- /dev/null +++ b/Scripts/update_loopandlearn_forks.sh @@ -0,0 +1,67 @@ +#!/bin/zsh + +# The purpose of this script is to update the loopandlearn forks to match the upstream repositories +# The script can only be run by someone with push privileges to the loopandlearn forks. + +source Scripts/define_common.sh + +section_divider +echo "You are running ${0}" +echo +echo " This automatically updates the downstream loopandlearn forks at GitHub" +echo " to match their respective upstream counterparts at LoopKit, bastiaanv and jbr7rr." +echo " Next, the forks that need to be manually managed will be opened so you" +echo " can handle the process at GitHub." +echo +echo " The automated process only works with push privileges to loopandlearn." +echo " Running the script without privileges yields error messages; no harm occurs." + +continue_or_quit ${0} + +# define the TRIO_PROJECT_FORKS to be updated +# these branches in loopandlearn should match the branches in the upstream repositories +TRIO_PROJECT_FORKS=( \ + LoopKit:CGMBLEKit:dev \ + LoopKit:dexcom-share-client-swift:dev \ + LoopKit:G7SensorKit:main \ + LoopKit:LibreTransmitter:main \ + LoopKit:MinimedKit:main \ + LoopKit:OmniBLE:dev \ + LoopKit:OmniKit:main \ + LoopKit:RileyLinkKit:dev \ + LoopKit:TidepoolService:dev \ + bastiaanv:DanaKit:dev \ + bastiaanv:EversenseKit:dev \ + jbr7rr:MedtrumKit:dev \ +) + +# This script uses remotes with the indicated nickname for the downstream repository +# If the proper remotes are not yet configured, they will be added later +DOWNSTREAM_GITHUB_NAME="loopandlearn" +DOWNSTREAM_NICKNAME="lal" + +section_divider +echo " ////////////// Automatically push updates from upstream repository to loopandlearn ////////////" +echo +for project in ${TRIO_PROJECT_FORKS}; do + IFS=":" read user dir branch <<< "$project" + echo " Make sure $branch for $dir is up to date" + cd $dir + git switch $branch + git pull + # Ensure remote is configured + if ! git remote get-url ${DOWNSTREAM_NICKNAME} &>/dev/null; then + echo " Adding remote ${DOWNSTREAM_NICKNAME} for $dir" + git remote add ${DOWNSTREAM_NICKNAME} https://github.com/${DOWNSTREAM_GITHUB_NAME}/$dir + fi + + echo " Push this update downstream to ${DOWNSTREAM_GITHUB_NAME}/$dir:$branch" + git push ${DOWNSTREAM_NICKNAME} $branch + echo "" + cd - +done + +# The next script is called automatically to enable manual evaluation for +# additional pump and cgm manager repositories. + +source Scripts/open_selected_url.sh \ No newline at end of file diff --git a/Scripts/update_submodule_refs.sh b/Scripts/update_submodule_refs.sh index b9edba347a..3fb71658a0 100755 --- a/Scripts/update_submodule_refs.sh +++ b/Scripts/update_submodule_refs.sh @@ -2,13 +2,24 @@ source Scripts/define_common.sh +section_divider +echo "You are running ${0}" +echo +echo " This modifies your local clone, in whatever branch is currently selected," +echo " so that every submodule is at the tip of the appropriate branch." +echo +current_branch=$(git branch --show-current 2>/dev/null) +echo " The current LoopWorkspace branch is $current_branch" + +continue_or_quit ${0} + for project in ${PROJECTS}; do + echo echo "Updating to $project" IFS=":" read user dir branch <<< "$project" echo "Updating to $branch on $user/$project" cd $dir git checkout $branch - #git branch -D tidepool-sync git pull cd - done