Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 14 Next capture
2021 2022 2023
2 captures
11 Jun 22 - 14 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
0
Question by joonturbo · Jul 17, 2015 at 02:48 PM · c#resourceslocalization

Is it possible to download and overwrite a .resx file on mobile?

My game uses SmartLocalization, which uses .resx files as resources to keep the localization data. Would it be possible to write a script that checks online for an update to the .resx and saves it on the local device?

Comment
Add comment
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

1 Reply

· Add your reply
  • Sort: 
avatar image
0

Answer by NiklasBorglund · Oct 26, 2015 at 08:22 PM

Yes it is possible. The following methods can help you in the LanguageManager found in SmartLocalization:

This method takes the language data sent in and tries to append it to the currently loaded language. LanguageManager.AppendLanguageWithTextData(string languageDataInResX)

This method tries to change the whole language with completely new data from the sent in .resx file. LanguageManager.ChangeLanguageWithTextData(string languageDataInResX, string languageCode)

Hope that helps. /Niklas

Comment
Add comment · Show 3 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image Anisoropos · Apr 01, 2016 at 11:37 AM 0
Share

Hey I'm trying to do something similar, though I don't need to load it from the web - just from a local folder. I've checked that the path is correct but no matter which of the two functions I use, I get the same error:

Any ideas why / how to solve it?

 XmlException: unexpected end of file. Current depth is 1  Line 2, position 98.
   at $$anonymous$$ono.Xml2.XmlTextReader.ReadContent () [0x00000] in <filename unknown>:0
   at $$anonymous$$ono.Xml2.XmlTextReader.Read () [0x00000] in <filename unknown>:0
   at System.Xml.XmlTextReader.Read () [0x00000] in <filename unknown>:0
   at SmartLocalization.LanguageParser.ReadElements (System.Xml.XmlReader reader, System.Collections.Generic.SortedDictionary`2 loadedLanguageDictionary) [0x00000] in <filename unknown>:0
   at SmartLocalization.LanguageParser.LoadLanguage (System.String languageDataInResX) [0x00000] in <filename unknown>:0
   at SmartLocalization.LanguageDataHandler.LoadLanguageDictionary (System.String resxData) [0x00000] in <filename unknown>:0
   at SmartLocalization.LanguageDataHandler.Load (System.String resxData) [0x00000] in <filename unknown>:0
   at SmartLocalization.Language$$anonymous$$anager.LoadLanguage (System.String languageData, System.String languageCode) [0x00000] in <filename unknown>:0
   at SmartLocalization.Language$$anonymous$$anager.ChangeLanguageWithData (System.String languageDataInResX, System.String languageCode) [0x00000] in <filename unknown>:0
   at Text$$anonymous$$anager.Initialize () [0x00023] in C:\Users\$$anonymous$$onstantinos\WorkInProgress\A Game of Coins\Unity Project\Assets\Scripts\Singletons\Text$$anonymous$$anager.cs:44 
avatar image Bunny83 Anisoropos · Apr 01, 2016 at 11:50 AM 0
Share

Well, as the error said you don't have a valid X$$anonymous$$L file:

XmlException: unexpected end of file

Have you edited the file manually? Are you sure you don't have any errors? Like an open element? $$anonymous$$aybe you wanted to create an empty element and forgot the "/" at the end?

X$$anonymous$$L parsers only accept 100% valid X$$anonymous$$L text, not like most browsers which interpret the HT$$anonymous$$L as good as possible.

avatar image Anisoropos Bunny83 · Apr 01, 2016 at 01:34 PM 0
Share

Turns out it was due to the localization asset - its function expected xmldata and I misunderstood and provided it with path to an xml. So it tried parsing the path as if it were the content of an xml file -_-

Thanks for the quick reply - in a weird way it pointed me to the right direction!

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this Question

Answers Answers and Comments

25 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

Multiple Cars not working 1 Answer

Distribute terrain in zones 3 Answers

How to link string to GameObject/Prefab, to load from? 1 Answer

What is the preferred practice when building for three languages? 1 Answer

How to make thumbnails from GameObjects? 3 Answers


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges