Notifications
bg
HUGO FERNANDES
Game Dev - Programmer
Goiânia, Brazil
0
Likes
8
Followers
2
Connections
All
Articles1
Games0
Showcases0
Column1
Jobs0
HUGO FERNANDES
updated the article
Nov 15, 2018 8:08 PM
Localized Text with Scriptable Objects.
A quick tutorial on an intuitive way to localize your texts.
Localized Text with Scriptable Objects.
Article
HUGO FERNANDES
2 months ago
@Riddhi Sharma Okay, to answer both questions. First, dropdown menu is similar to buttons, but instead of using the onClick callback it uses the OnValueChange. It's a little more complicated and out of the scope to this tutorial so I suggest you look for videos on the matter, but the logic for this localization remains the same. Second, I tested changing the local string asset on the fly and it worked, but after some tries the bug you mentioned did showed up. It's an unity editor "bug", btw. I solved it by adding UnityEditor.EditorUtility.SetDirty(mystring) at the first line of SetText() in the UseLocalString.cs Basically you just have to tell the editor to update the .asset after making changes to it.
RS
Riddhi Sharma
2 months ago
There's a glitch in your implementation. So if I change the content in the local string ( asset) and run it again, the text doesn't change. Let's take for example I want to edit my English Text to Hello. It still says "Bye" ( the one before). Also, I feel if I change a text in English, it should automatically change with other translations as well. Let's suppose I used the word "Bye" in English, it should also translate in Portugese and French during runtime.
RS
Riddhi Sharma
2 months ago
Hello Hugo, I was able to implement this tutorial. However, I would like to add a dropdown menu to be able to edit the text during runtime. Could you please help?
HUGO FERNANDES
2 months ago
@Riddhi Sharma The ChangeCurrentLanguage.cs exemplifies how to change the current language. All you have to do is to have a button in any options menu you make and add that script or something with similar logic.
HUGO FERNANDES
published the article
Oct 18, 2018 10:52 PM
Localized Text with Scriptable Objects.
A quick tutorial on an intuitive way to localize your texts.
Localized Text with Scriptable Objects.
Article
HUGO FERNANDES
2 months ago
@Riddhi Sharma Okay, to answer both questions. First, dropdown menu is similar to buttons, but instead of using the onClick callback it uses the OnValueChange. It's a little more complicated and out of the scope to this tutorial so I suggest you look for videos on the matter, but the logic for this localization remains the same. Second, I tested changing the local string asset on the fly and it worked, but after some tries the bug you mentioned did showed up. It's an unity editor "bug", btw. I solved it by adding UnityEditor.EditorUtility.SetDirty(mystring) at the first line of SetText() in the UseLocalString.cs Basically you just have to tell the editor to update the .asset after making changes to it.
RS
Riddhi Sharma
2 months ago
There's a glitch in your implementation. So if I change the content in the local string ( asset) and run it again, the text doesn't change. Let's take for example I want to edit my English Text to Hello. It still says "Bye" ( the one before). Also, I feel if I change a text in English, it should automatically change with other translations as well. Let's suppose I used the word "Bye" in English, it should also translate in Portugese and French during runtime.
RS
Riddhi Sharma
2 months ago
Hello Hugo, I was able to implement this tutorial. However, I would like to add a dropdown menu to be able to edit the text during runtime. Could you please help?
HUGO FERNANDES
2 months ago
@Riddhi Sharma The ChangeCurrentLanguage.cs exemplifies how to change the current language. All you have to do is to have a button in any options menu you make and add that script or something with similar logic.
About Me
Self-Taught Unity Developer.
Pontificia Universidade Catolica de Goiás PUC Goiás
Law
See more
Certifications (0)
Import
See all
HUGO FERNANDES's liked projects (0)
No likes yet
Following (2)
Followers (8)
Following Companies (0)
Not following anyone yet