Skip to content

Instantly share code, notes, and snippets.

@SpacyRicochet
Created October 10, 2016 08:42
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save SpacyRicochet/addeae7601de1ba54e19de440cc2db0b to your computer and use it in GitHub Desktop.
Save SpacyRicochet/addeae7601de1ba54e19de440cc2db0b to your computer and use it in GitHub Desktop.
Using lanes to update POEditor strings
desc "Downloads the latest apple_strings and updates the project with them."
lane :"update_strings" do
puts "Updating English."
update_language(lang: 'en', base: true)
puts "Updating French."
update_language(lang: 'fr')
puts "Updating German."
update_language(lang: 'de')
end
desc "Update the selected language."
desc "If it's the Base language, the Base.lproj file will be overwritten instead."
private_lane :"update_language" do |options|
lang = options[:lang]
path = "./Project/Localisation/" + (options[:base] ? "Base" : lang) + ".lproj/Localizable.strings"
poeditor_export(
api_token: ENV["PO_EDITOR_API_TOKEN"],
project_id: ENV["PO_EDITOR_PROJECT_ID"],
export_format: 'apple_strings',
language: lang,
tag: 'applestring',
output_path: path
)
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment