Skip to content
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
138 changes: 137 additions & 1 deletion fastlane/Fastfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,15 @@ default_platform(:ios)
import("./Certificates")

platform :ios do
# App Store Connect API credentials
key_id = ENV['APP_STORE_CONNECT_KEY_ID']
issuer_id = ENV['APP_STORE_CONNECT_ISSUER_ID']
key_content = ENV['APP_STORE_CONNECT_KEY']

# Claude API key for translations
anthropic_api_key = ENV['ANTHROPIC_API_KEY']
anthropic_model = "claude-sonnet-4-5"

lane :tests do
run_tests(scheme: "PIA VPN")
end
Expand Down Expand Up @@ -245,9 +250,140 @@ platform :ios do

end

desc "Update What's New text for all languages from metadata folder"
desc "Usage: fastlane update_release_notes"
desc "Edit fastlane/metadata/{locale}/release_notes.txt files before running this lane"
lane :update_release_notes do
api_key = app_store_connect_api_key(
key_id: key_id,
issuer_id: issuer_id,
key_content: key_content
)

UI.message("Uploading release notes from fastlane/metadata/ folder...")

deliver(
api_key: api_key,
app_identifier: "com.privateinternetaccess.ios.PIA-VPN",
skip_binary_upload: true,
skip_screenshots: true,
skip_metadata: false,
force: true,
precheck_include_in_app_purchases: false
)

UI.success("Successfully updated What's New text for all languages!")
end

desc "Translate release notes from English to all supported languages using Claude"
desc "Usage: fastlane translate_release_notes"
desc "Reads fastlane/metadata/en-US/release_notes.txt and translates to all locales"
lane :translate_release_notes do
require 'net/http'
require 'json'
require 'uri'

if anthropic_api_key.nil? || anthropic_api_key.empty?
UI.user_error!("ANTHROPIC_API_KEY environment variable not set. Please set it before running this lane.")
end

# Read the English release notes
english_notes_path = "../fastlane/metadata/en-US/release_notes.txt"
unless File.exist?(english_notes_path)
UI.user_error!("English release notes not found at #{english_notes_path}")
end

english_text = File.read(english_notes_path).strip
UI.message("Source text (English): #{english_text}")

# Define all target languages with their locale codes and language names
languages = {
"zh-Hans" => "Simplified Chinese",
"zh-Hant" => "Traditional Chinese",
"da" => "Danish",
"nl-NL" => "Dutch",
"en-AU" => "English (keep the same as source)",
"en-CA" => "English (keep the same as source)",
"en-GB" => "English (keep the same as source)",
"fr-FR" => "French",
"de-DE" => "German",
"id" => "Indonesian",
"it" => "Italian",
"ja" => "Japanese",
"ko" => "Korean",
"no" => "Norwegian",
"pt-BR" => "Brazilian Portuguese",
"ru" => "Russian",
"es-MX" => "Mexican Spanish",
"th" => "Thai",
"tr" => "Turkish"
}

# Translate to each language
languages.each do |locale, language_name|
UI.message("Translating to #{language_name} (#{locale})...")

# For English variants, just copy the source text
if locale.start_with?("en-")
target_path = "../fastlane/metadata/#{locale}/release_notes.txt"
File.write(target_path, english_text)
UI.success("Copied to #{locale}")
next
end

# Call Claude API for translation
uri = URI('https://api.anthropic.com/v1/messages')
http = Net::HTTP.new(uri.host, uri.port)
http.use_ssl = true
http.verify_mode = OpenSSL::SSL::VERIFY_NONE
http.read_timeout = 60

request = Net::HTTP::Post.new(uri.path)
request['Content-Type'] = 'application/json'
request['x-api-key'] = anthropic_api_key
request['anthropic-version'] = '2023-06-01'

prompt = "Translate the following app release notes to #{language_name}. These are release notes for Private Internet Access (PIA) VPN, a privacy and security app. Keep the same tone and style, and use appropriate VPN/privacy terminology for the target language. Only return the translated text, nothing else:\n\n#{english_text}"

request.body = {
model: anthropic_model,
max_tokens: 1024,
messages: [
{
role: 'user',
content: prompt
}
]
}.to_json

begin
response = http.request(request)

if response.code.to_i == 200
result = JSON.parse(response.body)
translated_text = result['content'][0]['text'].strip

# Write to the locale's release_notes.txt
target_path = "../fastlane/metadata/#{locale}/release_notes.txt"
File.write(target_path, translated_text)

UI.success("✓ #{locale}: #{translated_text[0..50]}...")
else
UI.error("Failed to translate to #{locale}: #{response.code} - #{response.body}")
end
rescue => e
UI.error("Error translating to #{locale}: #{e.message}")
end

# Small delay to avoid rate limiting
sleep(0.5)
end

UI.success("Translation complete! All release_notes.txt files have been updated.")
end

desc "Increase build number for TestFlight"
private_lane :increment_build_number_testflight do
private_lane :increment_build_number_testflight do
build_number = latest_testflight_build_number(
app_identifier: "com.privateinternetaccess.ios.PIA-VPN"
)
Expand Down
1 change: 1 addition & 0 deletions fastlane/metadata/da/release_notes.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Vi har tilføjet en forbindelsestimer, så du kan se, hvor længe din forbindelse har været beskyttet, og rettet nedbrud der påvirkede login på iPad og omarrangering af dashboard-felter.
1 change: 1 addition & 0 deletions fastlane/metadata/de-DE/release_notes.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Wir haben einen Verbindungstimer hinzugefügt, damit du sehen kannst, wie lange deine Verbindung bereits geschützt ist, und Abstürze behoben, die die Anmeldung auf dem iPad und das Neuanordnen der Dashboard-Kacheln betrafen.
1 change: 1 addition & 0 deletions fastlane/metadata/en-AU/release_notes.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
We added a connection timer so you can see how long your connection has been protected, and fixed crashes affecting login on iPad and reordering dashboard tiles.
1 change: 1 addition & 0 deletions fastlane/metadata/en-CA/release_notes.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
We added a connection timer so you can see how long your connection has been protected, and fixed crashes affecting login on iPad and reordering dashboard tiles.
1 change: 1 addition & 0 deletions fastlane/metadata/en-GB/release_notes.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
We added a connection timer so you can see how long your connection has been protected, and fixed crashes affecting login on iPad and reordering dashboard tiles.
1 change: 1 addition & 0 deletions fastlane/metadata/en-US/release_notes.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
We added a connection timer so you can see how long your connection has been protected, and fixed crashes affecting login on iPad and reordering dashboard tiles.
1 change: 1 addition & 0 deletions fastlane/metadata/es-MX/release_notes.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Agregamos un temporizador de conexión para que puedas ver cuánto tiempo ha estado protegida tu conexión, y corregimos fallos que afectaban el inicio de sesión en iPad y el reordenamiento de los mosaicos del panel de control.
1 change: 1 addition & 0 deletions fastlane/metadata/fr-FR/release_notes.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Nous avons ajouté un chronomètre de connexion pour que vous puissiez voir depuis combien de temps votre connexion est protégée, et corrigé des plantages affectant la connexion sur iPad et la réorganisation des tuiles du tableau de bord.
1 change: 1 addition & 0 deletions fastlane/metadata/id/release_notes.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Kami menambahkan penghitung waktu koneksi sehingga Anda dapat melihat berapa lama koneksi Anda telah terlindungi, dan memperbaiki crash yang memengaruhi login di iPad serta pengurutan ulang tile dashboard.
1 change: 1 addition & 0 deletions fastlane/metadata/it/release_notes.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Abbiamo aggiunto un timer di connessione per visualizzare da quanto tempo la tua connessione è protetta e risolto i crash che interessavano il login su iPad e il riordino dei riquadri della dashboard.
1 change: 1 addition & 0 deletions fastlane/metadata/ja/release_notes.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
接続タイマーを追加し、接続が保護されている時間を確認できるようになりました。また、iPadでのログイン時のクラッシュとダッシュボードタイルの並び替えに影響する問題を修正しました。
1 change: 1 addition & 0 deletions fastlane/metadata/ko/release_notes.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
연결 타이머를 추가하여 연결이 보호된 시간을 확인할 수 있으며, iPad 로그인 및 대시보드 타일 재정렬 시 발생하던 충돌 문제를 수정했습니다.
1 change: 1 addition & 0 deletions fastlane/metadata/nl-NL/release_notes.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
We hebben een verbindingstimer toegevoegd zodat je kunt zien hoe lang je verbinding al beschermd is, en crashes verholpen die inloggen op iPad en het herschikken van dashboardtegels beïnvloedden.
1 change: 1 addition & 0 deletions fastlane/metadata/no/release_notes.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Vi har lagt til en tilkoblingstimer slik at du kan se hvor lenge tilkoblingen din har vært beskyttet, og fikset krasj som påvirket innlogging på iPad og omorganisering av dashbord-fliser.
1 change: 1 addition & 0 deletions fastlane/metadata/pt-BR/release_notes.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Adicionamos um cronômetro de conexão para que você possa ver há quanto tempo sua conexão está protegida e corrigimos travamentos que afetavam o login no iPad e a reordenação dos blocos do painel.
1 change: 1 addition & 0 deletions fastlane/metadata/ru/release_notes.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Мы добавили таймер подключения, чтобы вы могли видеть, как долго ваше соединение находится под защитой, а также исправили сбои при входе на iPad и при изменении порядка плиток на главном экране.
1 change: 1 addition & 0 deletions fastlane/metadata/th/release_notes.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
เราได้เพิ่มตัวจับเวลาการเชื่อมต่อเพื่อให้คุณสามารถดูได้ว่าการเชื่อมต่อของคุณได้รับการปกป้องมานานเท่าใด และแก้ไขปัญหาการหยุดทำงานที่ส่งผลต่อการเข้าสู่ระบบบน iPad และการจัดเรียงไทล์แดชบอร์ดใหม่
1 change: 1 addition & 0 deletions fastlane/metadata/tr/release_notes.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Bağlantı sürenizin ne kadar süredir korunduğunu görebilmeniz için bir bağlantı zamanlayıcısı ekledik ve iPad'de oturum açmayı ve gösterge paneli kutucuklarını yeniden sıralamayı etkileyen çökmeleri düzelttik.
1 change: 1 addition & 0 deletions fastlane/metadata/zh-Hans/release_notes.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
我们添加了连接计时器,让您可以查看连接受保护的时长,并修复了影响 iPad 登录和重新排列仪表板磁贴的崩溃问题。
1 change: 1 addition & 0 deletions fastlane/metadata/zh-Hant/release_notes.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
我們新增了連線計時器,讓您可以查看連線受保護的時長,並修復了影響 iPad 登入和重新排列儀表板磚塊的閃退問題。