Created
October 10, 2016 08:42
-
-
Save SpacyRicochet/addeae7601de1ba54e19de440cc2db0b to your computer and use it in GitHub Desktop.
Using lanes to update POEditor strings
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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