lib/Localization.rb in pixab-1.2.7 vs lib/Localization.rb in pixab-1.3.0
- old
+ new
@@ -10,10 +10,11 @@
class Localization
ACCESS_TOKEN = 'bdbda2cc022951235808a4f6c7a7330d4de7dcf719650d7d2ceee260e07d3f01'
Project_AirBrush = '546ed49bfca9d3a4f51ccf2c8c279d0f'
Project_AirBrush_Video = 'fcb3e858aa1d991e8c21222f3696ce67'
+ Project_AirBrush_Studio = '16a0814854c608d496e8a410f567666b'
attr_accessor :projects, :tags, :platform, :mode
def initialize()
@platform = 'iOS'
@@ -37,10 +38,14 @@
@tags = 'iOS'
when '--abv-iOS'
@projects = "#{Project_AirBrush_Video}"
@mode = 'add'
@tags = 'iOS'
+ when '--ab-Mac'
+ @projects = "#{Project_AirBrush_Studio}"
+ @platform = 'Mac'
+ @mode = 'add'
end
end
commands.each_index do |index|
command = commands[index]
@@ -75,11 +80,10 @@
project_array.each do |project|
page_number = 1
while true
link = "\"https://api.phrase.com/v2/projects/#{project}/translations?page=#{page_number}&per_page=100&sort=created_at"
if !tags.nil?
- # excluded:false
link += "&q=tags:#{tags}%20excluded:false"
end
link += "\""
access_token = "-u #{ACCESS_TOKEN}:"
localized_string = `curl #{link} #{access_token}`
@@ -122,9 +126,11 @@
if !mode.nil?
platform_commands = ['--mode', mode]
end
if platform == 'android'
LocalizationAndroid.new.run(localized_info_category, platform_commands)
+ elsif platform == 'Mac'
+ LocalizationMac.new.run(localized_info_category, platform_commands)
else
LocalizationiOS.new.run(localized_info_category, platform_commands)
end
end