Skip to content
This repository was archived by the owner on Aug 21, 2025. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions app/lint.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,6 @@
<lint>
<issue id="GradleDependency" severity="ignore"/>
<issue id="AndroidGradlePluginVersion" severity="ignore" />
<issue id="ExtraTranslation" severity="ignore" />
<issue id="MissingTranslation" severity="ignore" />
</lint>
53 changes: 53 additions & 0 deletions fastlane/Fastfile
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,31 @@ BUILD_CODE_FORMATTER = Fastlane::Wpmreleasetoolkit::Versioning::DerivedBuildCode
PROTOTYPE_BUILD_DOMAIN = 'https://cdn.a8c-ci.services'
RELEASE_BUILD_TYPE = 'Release'

GLOTPRESS_PROJECT_BASE_URL = 'https://translate.wordpress.com/projects/gravatar/gravatar-android'
RESOURCES_TO_TRANSLATE = {
File.join('homeUi', 'src', 'main', 'res') => "#{GLOTPRESS_PROJECT_BASE_URL}/login-ui/",
File.join('loginUi', 'src', 'main', 'res') => "#{GLOTPRESS_PROJECT_BASE_URL}/home-ui/"
}.freeze

SUPPORTED_LOCALES = [
{ glotpress: 'ar', android: 'ar' },
{ glotpress: 'de', android: 'de' },
{ glotpress: 'es', android: 'es' },
{ glotpress: 'fr', android: 'fr' },
{ glotpress: 'he', android: 'iw' },
{ glotpress: 'id', android: 'in' },
{ glotpress: 'it', android: 'it' },
{ glotpress: 'ja', android: 'ja' },
{ glotpress: 'ko', android: 'ko' },
{ glotpress: 'nl', android: 'nl' },
{ glotpress: 'pt-br', android: 'pt-rBR' },
{ glotpress: 'ru', android: 'ru' },
{ glotpress: 'sv', android: 'sv' },
{ glotpress: 'tr', android: 'tr' },
{ glotpress: 'zh-cn', android: 'zh-rCN' },
{ glotpress: 'zh-tw', android: 'zh-rTW' }
].freeze

platform :android do
# Builds a release app bundle (.aab) for the Gravatar Android app
#
Expand Down Expand Up @@ -136,6 +161,34 @@ platform :android do
upload_to_store(track: track, release_status: release_status, rollout: release_status == 'draft' ? nil : '1')
end

# Download the latest app translations from GlotPress and update the strings.xml files accordingly.
#
# @example Running the lane
# bundle exec fastlane download_translations skip_commit:true
#
# @param skip_commit [Boolean] Skip committing the changes to git (default: false)
#
lane :download_translations do |skip_commit: false|
RESOURCES_TO_TRANSLATE.each do |res_dir, gp_url|
android_download_translations(
res_dir: res_dir.to_s,
glotpress_url: gp_url,
locales: SUPPORTED_LOCALES,
skip_commit: true
)
end

next if skip_commit

strings_paths = RESOURCES_TO_TRANSLATE.keys.map(&:to_s)
git_add(path: strings_paths)
git_commit(
path: strings_paths,
message: 'Update translations',
allow_nothing_to_commit: true
)
end

#####################################################################################
# Release lanes
#####################################################################################
Expand Down
9 changes: 9 additions & 0 deletions homeUi/src/main/res/values-ar/strings.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
Translation-Revision-Date: +0000
Plural-Forms: nplurals=6; plural=n==0 ? 0 : n==1 ? 1 : n==2 ? 2 : n%100>=3 && n%100<=10 ? 3 : n%100>=11 && n%100<=99 ? 4 : 5;
Generator: GlotPress/2.4.0-alpha
Language: ar
-->
<resources>
</resources>
9 changes: 9 additions & 0 deletions homeUi/src/main/res/values-de/strings.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
Translation-Revision-Date: +0000
Plural-Forms: nplurals=2; plural=n != 1;
Generator: GlotPress/2.4.0-alpha
Language: de
-->
<resources>
</resources>
9 changes: 9 additions & 0 deletions homeUi/src/main/res/values-es/strings.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
Translation-Revision-Date: +0000
Plural-Forms: nplurals=2; plural=n != 1;
Generator: GlotPress/2.4.0-alpha
Language: es
-->
<resources>
</resources>
9 changes: 9 additions & 0 deletions homeUi/src/main/res/values-fr/strings.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
Translation-Revision-Date: +0000
Plural-Forms: nplurals=2; plural=n > 1;
Generator: GlotPress/2.4.0-alpha
Language: fr
-->
<resources>
</resources>
9 changes: 9 additions & 0 deletions homeUi/src/main/res/values-in/strings.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
Translation-Revision-Date: +0000
Plural-Forms: nplurals=2; plural=n > 1;
Generator: GlotPress/2.4.0-alpha
Language: id
-->
<resources>
</resources>
9 changes: 9 additions & 0 deletions homeUi/src/main/res/values-it/strings.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
Translation-Revision-Date: +0000
Plural-Forms: nplurals=2; plural=n != 1;
Generator: GlotPress/2.4.0-alpha
Language: it
-->
<resources>
</resources>
9 changes: 9 additions & 0 deletions homeUi/src/main/res/values-iw/strings.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
Translation-Revision-Date: +0000
Plural-Forms: nplurals=2; plural=n != 1;
Generator: GlotPress/2.4.0-alpha
Language: he_IL
-->
<resources>
</resources>
9 changes: 9 additions & 0 deletions homeUi/src/main/res/values-ja/strings.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
Translation-Revision-Date: +0000
Plural-Forms: nplurals=1; plural=0;
Generator: GlotPress/2.4.0-alpha
Language: ja_JP
-->
<resources>
</resources>
9 changes: 9 additions & 0 deletions homeUi/src/main/res/values-ko/strings.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
Translation-Revision-Date: +0000
Plural-Forms: nplurals=1; plural=0;
Generator: GlotPress/2.4.0-alpha
Language: ko_KR
-->
<resources>
</resources>
9 changes: 9 additions & 0 deletions homeUi/src/main/res/values-nl/strings.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
Translation-Revision-Date: +0000
Plural-Forms: nplurals=2; plural=n != 1;
Generator: GlotPress/2.4.0-alpha
Language: nl
-->
<resources>
</resources>
9 changes: 9 additions & 0 deletions homeUi/src/main/res/values-pt-rBR/strings.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
Translation-Revision-Date: +0000
Plural-Forms: nplurals=2; plural=(n > 1);
Generator: GlotPress/2.4.0-alpha
Language: pt_BR
-->
<resources>
</resources>
9 changes: 9 additions & 0 deletions homeUi/src/main/res/values-ru/strings.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
Translation-Revision-Date: +0000
Plural-Forms: nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2);
Generator: GlotPress/2.4.0-alpha
Language: ru
-->
<resources>
</resources>
17 changes: 17 additions & 0 deletions homeUi/src/main/res/values-sv/strings.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
Translation-Revision-Date: 2025-07-29 15:31:37+0000
Plural-Forms: nplurals=2; plural=n != 1;
Generator: GlotPress/2.4.0-alpha
Language: sv_SE
-->
<resources>
<string name="login_authorization_denied_title">Du måste logga in på Gravatar.com</string>
<string name="login_profile_load_failure_alternative_cta">Prova med ett annat konto</string>
<string name="login_profile_load_failure_cta">Försök igen</string>
<string name="login_profile_load_failure_generic_message">Det var ett problem att ladda in din profil.</string>
<string name="login_profile_load_failure_title">Kan inte ladda din profil</string>
<string name="login_retrieving_token_failure_message">Något gick fel</string>
<string name="log_in">Logga in</string>
<string name="your_globally_recognized_avatar">Din globalt igenkända profilbild.</string>
</resources>
9 changes: 9 additions & 0 deletions homeUi/src/main/res/values-tr/strings.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
Translation-Revision-Date: +0000
Plural-Forms: nplurals=2; plural=(n > 1);
Generator: GlotPress/2.4.0-alpha
Language: tr
-->
<resources>
</resources>
9 changes: 9 additions & 0 deletions homeUi/src/main/res/values-zh-rCN/strings.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
Translation-Revision-Date: +0000
Plural-Forms: nplurals=1; plural=0;
Generator: GlotPress/2.4.0-alpha
Language: zh_CN
-->
<resources>
</resources>
9 changes: 9 additions & 0 deletions homeUi/src/main/res/values-zh-rTW/strings.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
Translation-Revision-Date: +0000
Plural-Forms: nplurals=1; plural=0;
Generator: GlotPress/2.4.0-alpha
Language: zh_TW
-->
<resources>
</resources>
23 changes: 23 additions & 0 deletions homeUi/src/main/res/values/available_languages.xml
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(Nothing to change here, just me ranting)

That reminds me that this file (generated by our gp_download_translations helper from release-toolkit) is quite obsolete now…

  • This was a file used by the WordPress Android project only, so that they can load it at runtime from their code to then have a custom language picker
  • But now WPAndroid have migrated to getting rid to the custom, in-app locale picker and using more modern Android APIs that offers system-level locale switching (similar to iOS supporting setting the locale per app in System Settings)… so I don't think it's used in WPAndroid anymore
  • And to my knowledge it's not used by any other project…

That shows the legacy of those helpers 😅

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ahh thanks for the context 👍 I was curious why this file was being generated in the first place; just checked a few projects that still have it, and imagined it might still be used elsewhere 😅

Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--Warning: Auto-generated file, do not edit.-->
<resources xmlns:tools="http://schemas.android.com/tools">
<string-array name="available_languages" translatable="false" tools:ignore="InconsistentArrays">

Check warning on line 4 in homeUi/src/main/res/values/available_languages.xml

View check run for this annotation

GitHub Advanced Security / Android Lint

Unused resources

The resource R.array.available_languages appears to be unused
<item>en_US</item>
<item>ar</item>
<item>de</item>
<item>es</item>
<item>fr</item>
<item>iw</item>
<item>in</item>
<item>it</item>
<item>ja</item>
<item>ko</item>
<item>nl</item>
<item>pt_BR</item>
<item>ru</item>
<item>sv</item>
<item>tr</item>
<item>zh_CN</item>
<item>zh_TW</item>
</string-array>
</resources>
9 changes: 9 additions & 0 deletions loginUi/src/main/res/values-ar/strings.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
Translation-Revision-Date: +0000
Plural-Forms: nplurals=6; plural=n==0 ? 0 : n==1 ? 1 : n==2 ? 2 : n%100>=3 && n%100<=10 ? 3 : n%100>=11 && n%100<=99 ? 4 : 5;
Generator: GlotPress/2.4.0-alpha
Language: ar
-->
<resources>
</resources>
9 changes: 9 additions & 0 deletions loginUi/src/main/res/values-de/strings.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
Translation-Revision-Date: +0000
Plural-Forms: nplurals=2; plural=n != 1;
Generator: GlotPress/2.4.0-alpha
Language: de
-->
<resources>
</resources>
9 changes: 9 additions & 0 deletions loginUi/src/main/res/values-es/strings.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
Translation-Revision-Date: +0000
Plural-Forms: nplurals=2; plural=n != 1;
Generator: GlotPress/2.4.0-alpha
Language: es
-->
<resources>
</resources>
9 changes: 9 additions & 0 deletions loginUi/src/main/res/values-fr/strings.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
Translation-Revision-Date: +0000
Plural-Forms: nplurals=2; plural=n > 1;
Generator: GlotPress/2.4.0-alpha
Language: fr
-->
<resources>
</resources>
9 changes: 9 additions & 0 deletions loginUi/src/main/res/values-in/strings.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
Translation-Revision-Date: +0000
Plural-Forms: nplurals=2; plural=n > 1;
Generator: GlotPress/2.4.0-alpha
Language: id
-->
<resources>
</resources>
9 changes: 9 additions & 0 deletions loginUi/src/main/res/values-it/strings.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
Translation-Revision-Date: +0000
Plural-Forms: nplurals=2; plural=n != 1;
Generator: GlotPress/2.4.0-alpha
Language: it
-->
<resources>
</resources>
9 changes: 9 additions & 0 deletions loginUi/src/main/res/values-iw/strings.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
Translation-Revision-Date: +0000
Plural-Forms: nplurals=2; plural=n != 1;
Generator: GlotPress/2.4.0-alpha
Language: he_IL
-->
<resources>
</resources>
9 changes: 9 additions & 0 deletions loginUi/src/main/res/values-ja/strings.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
Translation-Revision-Date: +0000
Plural-Forms: nplurals=1; plural=0;
Generator: GlotPress/2.4.0-alpha
Language: ja_JP
-->
<resources>
</resources>
9 changes: 9 additions & 0 deletions loginUi/src/main/res/values-ko/strings.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
Translation-Revision-Date: +0000
Plural-Forms: nplurals=1; plural=0;
Generator: GlotPress/2.4.0-alpha
Language: ko_KR
-->
<resources>
</resources>
9 changes: 9 additions & 0 deletions loginUi/src/main/res/values-nl/strings.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
Translation-Revision-Date: +0000
Plural-Forms: nplurals=2; plural=n != 1;
Generator: GlotPress/2.4.0-alpha
Language: nl
-->
<resources>
</resources>
9 changes: 9 additions & 0 deletions loginUi/src/main/res/values-pt-rBR/strings.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
Translation-Revision-Date: +0000
Plural-Forms: nplurals=2; plural=(n > 1);
Generator: GlotPress/2.4.0-alpha
Language: pt_BR
-->
<resources>
</resources>
9 changes: 9 additions & 0 deletions loginUi/src/main/res/values-ru/strings.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
Translation-Revision-Date: +0000
Plural-Forms: nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2);
Generator: GlotPress/2.4.0-alpha
Language: ru
-->
<resources>
</resources>
Loading