How to get localized DisplayName for enums

Mon 9. Apr 2018, 14:10

I have Drop-down list in my feature and I need to get localized DisplayName for generated enum. How to do it?
Mikhail
 
Posts: 8
Joined: Fri 30. Mar 2018, 09:57

Re: How to get localized DisplayName for enums

Mon 9. Apr 2018, 15:28

Hi Mikhail,

for enums we currently don't use their DisplayName, only their TechnicalName, therefore we don't have localization out of the box.

If you need to localize them, you can use the custom localization feature inside the plugin and use the general_*.xlsx to localize your enums manually.
Using the enum type and name as the key into the excel file.

But i will note that feature request for localizing enums aswell

Hope that helps

Best regards

Nico
Nico Probst
Senior Software Engineer | Articy | LinkedIn
User avatar
[Articy] Nico Probst
Articy Staff
Articy Staff
 
Posts: 217
Joined: Wed 23. Nov 2011, 09:45
Location: Bochum

Re: How to get localized DisplayName for enums

Tue 10. Apr 2018, 14:17

Something is not working

1) Created general_ru.xlsx with format identical of loc_All objects_ru.xlsx
2) Call ArticyDatabase.Localization.Localize ("QuestType.MainQuest"); But in return I get same "QuestType.MainQuest" string.

PS. tried to attach general_ru.xlsx file and screenshot of its content, but get errors:
1) The extension xlsx is not allowed.
2) The image must be at least 0 pixels wide, 0 pixels high and at most 600 pixels wide and 0 pixels high. The submitted image is 793 pixels wide and 130 pixels high.
Mikhail
 
Posts: 8
Joined: Fri 30. Mar 2018, 09:57

Re: How to get localized DisplayName for enums

Wed 11. Apr 2018, 09:10

Hi Mikhail,

hm, that sounds odd. From what i can tell you did everything correctly. I tested this with the latest version and got it working that way.

Please check if the current language is set to "ru", you can do that via the articy tab and check "Current Language". Especially make sure that no spaces are used.
If the current language is set go into your Asset/ folder and check if in ArticyContent/Generated/Resources there should be an asset called "general_ru".
If it exists click on it and enable debug mode in the inspector to see its content. Make sure your entry is in "M Loca Keys" and "M Loca Values".

If nothing helped there must be a different problem, if that is the case please send us a quick email to support@nevigo.com with the excel file, if possible the articyu3d file or the unity project and i will see whats going on.

Sorry for the inconvenience

Best regards

Nico
Nico Probst
Senior Software Engineer | Articy | LinkedIn
User avatar
[Articy] Nico Probst
Articy Staff
Articy Staff
 
Posts: 217
Joined: Wed 23. Nov 2011, 09:45
Location: Bochum

Re: How to get localized DisplayName for enums

Wed 11. Apr 2018, 23:30

I found a problem. I read this in your docs (https://www.nevigo.com/articy-importer/ ... calization)

...To do that you need to create a new xlsx file next to the normal localization file in your Asset/ folder. general_<Language identifier>.xlsx


So I put my xlsx-file right into the root of "Asset" folder. But my articyu3d-file was in "Asset/Data" folder (didn't get "next to the normal localization file" correctly).

Then I moved xlsx-file into "Asset/Data" and this solved my problem.
Mikhail
 
Posts: 8
Joined: Fri 30. Mar 2018, 09:57

Return to articy:draft Unity Importer

Who is online

Users browsing this forum: No registered users and 47 guests

Who We Are
Contact Us
Social Links