Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[iOS] Custom localized string file in iOS App #3957

Closed
ktronic80 opened this issue Nov 3, 2014 · 4 comments
Closed

[iOS] Custom localized string file in iOS App #3957

ktronic80 opened this issue Nov 3, 2014 · 4 comments
Assignees
Labels
Milestone

Comments

@ktronic80
Copy link
Contributor

Hi,

I'm currently automating an iOS app which has multiple files for localized strings. The app project structure looks like this:
<project_root>/Strings/en.lproj/Localizable.strings
<project_root>/Strings/en.lproj/appname.strings
<project_root>/Strings/de.lproj/Localizable.strings
<project_root>/Strings/de.lproj/appname.strings
...

All stings are in the appname.strings file. The Localizable.strings file is just there to get push messages properly working, it just contains one string.

I'm using the Appium java client for my tests and want to use some information form the string files. But the AppiumDriver getAppStrings methods just returns the content of the Localizable.strings string file.

As far as I can see on the Appium server side in ios.js file parseLocalizableStrings method just consider the Localizable.strings file.

Is it somehow possible to specify a file different from Localizable.strings to be parsed as app string file?

I compiled the Appium java client from the current master.
I'm using Appium verions 1.3.0

@triager triager added the Needs Triage bugs which are not yet confirmed label Nov 3, 2014
@Jonahss
Copy link
Member

Jonahss commented Nov 3, 2014

It's not currently possible, but looks pretty easy to add.
You found the right place in the code, do you think this is something you would be willing to write and contribute as a pull request?

What do you think would be the most useful way to get the strings? Either the method could take the filename as an argument, or maybe it could return ALL the strings by concatenating the files. What do you think?

@ktronic80
Copy link
Contributor Author

Yes I can add this.

I would prefer the method to specify the filename as parameter. I talked to an iOS dev and he told me thats possible to have the same key in multiple files e.g. in the Localizable.strings and the appname.strings and somehow you can decide in the app which to use. Currently the request returns one json object with all key value pairs. How should that be handled in the case of multiple keys?

If no file name is passed as parameter I would just return the content from Localizable.strings this would preserve the current behavior.

@Jonahss
Copy link
Member

Jonahss commented Nov 10, 2014

I like it. Specify the file name as an argument, and the default is the same as the current behavior.

Need any other help?

@Jonahss Jonahss assigned Jonahss and unassigned Jonahss Nov 10, 2014
@Jonahss Jonahss added Enhancement feature and removed Needs Triage bugs which are not yet confirmed labels Nov 10, 2014
@Jonahss Jonahss added this to the Appium 1.3.4 milestone Nov 10, 2014
ktronic80 added a commit to ktronic80/appium that referenced this issue Nov 18, 2014
ktronic80 added a commit to ktronic80/appium that referenced this issue Nov 24, 2014
…troller.js. cb is now last method parameter. Also update Android and Selendroid getStrings methods with stringFile parameter to fit getStrings method parameter called in controller.js. Added test for method parseLocalizableStrings in ios.js.
ktronic80 added a commit to ktronic80/appium that referenced this issue Dec 1, 2014
…d corrected parameter of call of parseLocalizableStrings function in ios-contoller.js
jlipps added a commit that referenced this issue Dec 1, 2014
#3957 added string file parameter to getStrings request for iOS.
@jlipps jlipps closed this as completed Dec 1, 2014
sebv pushed a commit that referenced this issue Dec 1, 2014
…r.js. cb is now last method parameter. Also update Android and Selendroid getStrings methods with stringFile parameter to fit getStrings method parameter called in controller.js. Added test for method parseLocalizableStrings in ios.js.
sebv pushed a commit that referenced this issue Dec 1, 2014
…ected parameter of call of parseLocalizableStrings function in ios-contoller.js
@lock
Copy link

lock bot commented May 2, 2019

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@lock lock bot locked and limited conversation to collaborators May 2, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

4 participants