fastlane-old / snapshot

Automate taking localized screenshots of your iOS app on every device
https://fastlane.tools
1.95k stars 140 forks source link

Save images to locale folder if provided #474

Closed makadaw closed 8 years ago

makadaw commented 8 years ago

Now if you provide locale like "pt", ["pt", "pt-BR"] it will save images to the same folder "pt". This fix use locale as folder name is user provide it

KrauseFx commented 8 years ago

Could you clarify a bit more on what this change does? Why is it necessary?

makadaw commented 8 years ago

Sure. For example we set up few languages

languages([
  "en-US",
  "pt", #Portuguese
  ["pt", "pt_BR"] # Portuguese with Brazilian locale
])
output_directory './screenshots'

Now snapshot will create only 2 directories:

./screenshots/en-US 
./screenshots/pt 

So screenshots for pt_BR will be placed in pt directory. So I added condition that check if user set locale and with this changes snapshot will create 3 directories:

./screenshots/en-US 
./screenshots/pt 
./screenshots/pt_BR
makadaw commented 8 years ago

Maybe you can improve my code (I'm not very good in Ruby :) )

i2amsam commented 8 years ago

@makadaw :+1: thanks! this is great!