Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 13 Next capture
2021 2022 2023
2 captures
13 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
2
Question by stevethorne · Jan 17, 2015 at 04:54 PM · uitext4.6localization

Localization in the new uGUI

Prior to 4.6, the team I work with used EZGUI to do their UI.

We were able to accomplish localization by placing the stringids in EZGUIs text objects and then modify the Awake function of that object to replace it's text with the proper text from our localization manager. This was very fast due to the fact that it was handled in each of the text objects awake functions rather than searching for each text object in the scene to replace its text.

Looking at the new unity UI I'm not seeing a really great way of replacing the text on each of the text objects. Certainly, I could search through all of the objects in the scene and replace the text on each one, but that would be tremendously slow in a large-scale project. I could also place a component on each text object to replace the text but again, that wouldn't be ideal as the component would have to get the text component and that would be a bit slow with all of the text objects in a large-scale project.

I also thought about creating new classes that derive from the Text class and override the awake to do our localization. The only downside to this is that I wouldn't be able to remove the old Text component from the context menu when adding an object, and I would also have to derive from other classes such as the button class to ensure that it doesn't automatically add the old Text object underneath itself. This could prove to be a hassle as we would have to ensure that everyone on the project didn't accidentally choose the old class when setting up UI for the game.

I'm looking for some suggestions of things that I could do to accomplish this. Perhaps I missed something when looking through the new UI classes. I'm really hoping there's a better way to go about doing this and that I don't have to go with one of the solutions listed above.

Thanks in advance for all of your help!

Comment
Add comment · Show 1
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 stevethorne · Jan 17, 2015 at 10:19 PM 0
Share

I thought of another possible solution but I'm still not liking the manual labor of it. The script that controls the ui that those controls are on could have references to each control that needs it's text replaced. Still really inconvenient for real work. Can anyone think of anything better or is one of my solutions the best bet?

3 Replies

· Add your reply
  • Sort: 
avatar image
0

Answer by JPB18 · Mar 06, 2015 at 04:23 PM

Well, I just found this: (scroll to the bottom)

http://www.pixelcrushers.com/dialogue_system/manual/html/unity_u_i_dialogue_u_i.html

I was also looking for that solution! :D

Comment
Add comment · 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
0

Answer by DrakharStudio · Mar 09, 2015 at 11:43 AM

Well, hmmm. Unity's UI is open source, so you could modify the code of the standard Text object to suit your needs, right?

Comment
Add comment · 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
0

Answer by YoungXi · Mar 24, 2017 at 10:53 PM

I can only think of one way for this: Override the MenuItem for Button or Text or anyother components includes a text.

[MenuItem("GameObject/UI/Button", false, 2030)] for more detail , you can check out the Unity ui source code .

Comment
Add comment · 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

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

30 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 avatar image avatar image avatar image avatar image avatar image

Related Questions

Text blurred: uGUI 4.6 9 Answers

4.6 UI Text rect does not expand automatically 2 Answers

uGUI letter spacing and kerning 1 Answer

Multiple Canvases 1 World Space 1 Screen Space Overlay Events Pass Through? 1 Answer

TMP shows default system font instead of drawing box. 0 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