ios - Xcode 6.3.2 or 6.4beta Localization failed to read a strings file -


yes, know there many discussions failure. after checking them out, think have different.

in here error while "export localization.." xcode 6.3, says single quote (') should replaced (\') in strings file.

in here xcode 6 localization failed read strings file, says nslocalizedstring should commented out (if understand right).

to test problem, created new project 6.3.2 , 6.4(6e23). can have single quotes in strings file, long there nslocalizedstring (e.g. var str = nslocalizedstring("hi", tablename: nil, bundle: nsbundle.mainbundle(), value: "hi", comment: "hi")) in view controller file, xcode pops enter image description here

then did

xcodebuild -exportlocalizations -localizationpath ./xliff -project testtest.xcodeproj -exportlanguage en 

and get

bad entry in file viewcontroller.swift (line = 26): argument not literal string.

2015-06-15 11:08:22.177 xcodebuild[31272:1150546]

[mt] dvtassertions: warning in /sourcecache/ideframeworks/ideframeworks-7718/idefoundation/localization/idelocalizationwork.m:434

details: failed read strings file "/var/folders/1s/_d08hx4j2gn9t6wlrc5_7gq00000gn/t/xcode3sourcestringsadaptor-48cae246-eba5-4326-b3c5-b5032a4027d8/localizable.strings", underlying error:

the data couldn’t read because isn’t in correct format.

object: idelocalizationwork

method: +readstringsworkforcontext:

thread: {number = 1, name = main} please file bug @ http://bugreport.apple.com warning message , useful information can provide.

xcodebuild: error: localization failed read strings file

this error persists if comment out line 26,

var str = nslocalizedstring("hi", tablename: nil, bundle: nsbundle.mainbundle(), value: "hi", comment: "hi") 

but if delete line 26, error gone.

so, guese, xliff generator somehow not allow "nslocalizedstring" appear whatsoever??

have ever found did?

there several problems, cause error:

1. empty localizable.strings file.

solution: add comment

    /** no localizable strings **/ 

to file , problem gone.

2. 2-nd problem in escape symbol: \ (sometimes)

solution: remove , figure out special chars. , export process complete without errors.

also \ produce bug:

sting export:

"account" = "foo\\\'bar\'bazz\""; 

string after importing exported file:

"account" = "\\''"; 

bonus:

if try import localization during exporting xcode crash!

welcome localization hell apple!


p.s.


Comments

Popular posts from this blog

javascript - Google App Script ContentService downloadAsFile not working -

javascript - Function overwritting -

php - Find a regex to take part of Email -