Notifications
bg
HUGO FERNANDES
Game Dev - Programmer
Goiânia, Brazil
1
Like
9
Followers
2
Connections
All
Articles1
Games0
Showcases0
Column1
Jobs0
HUGO FERNANDES
updated the article
Nov 16, 2018
Localized Text with Scriptable Objects.
Localized Text with Scriptable Objects.
A quick tutorial on an intuitive way to localize your texts.
MB
8 months ago
Thanks for this tutorial. I implemented something similar and wanted to have a look if others have done localisation with scriptable objects and found your blog. However, I opted for a version were I have scriptable objects for languages holding the file path of a JSON. This allows me to easily store and change values in the JSON. I also implemented that the JSON only gets loaded when needed so I dont have to load all texts from all languages on start. The individual localisedText scripts then just hold an ID which corresponds to the respective strings in the JSON. I am also using a scriptable object event system to reload the text when someone changes langauges. I see the advantage of using JSONs that if I need a new language I can just send the whole JSON to a translator who can translate everything not having to know anything at all about Unity and I only load the texts that are needed. Best regards
MB
8 months ago
Hi Hugo
a year 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
a year 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.
View More Comments
HUGO FERNANDES
published the article
Oct 19, 2018
Localized Text with Scriptable Objects.
Localized Text with Scriptable Objects.
A quick tutorial on an intuitive way to localize your texts.
MB
8 months ago
Thanks for this tutorial. I implemented something similar and wanted to have a look if others have done localisation with scriptable objects and found your blog. However, I opted for a version were I have scriptable objects for languages holding the file path of a JSON. This allows me to easily store and change values in the JSON. I also implemented that the JSON only gets loaded when needed so I dont have to load all texts from all languages on start. The individual localisedText scripts then just hold an ID which corresponds to the respective strings in the JSON. I am also using a scriptable object event system to reload the text when someone changes langauges. I see the advantage of using JSONs that if I need a new language I can just send the whole JSON to a translator who can translate everything not having to know anything at all about Unity and I only load the texts that are needed. Best regards
MB
8 months ago
Hi Hugo
a year 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
a year 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.
View More Comments
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 (9)
Following Companies (0)
Not following anyone yet