How to implement translations (English + Hindi) in Storyboard projects? Hindi not displaying
Hi everyone,
I’m trying to add multi-language support (English + Hindi) to my Storyboard project, but I’m facing issues.
What I have so far:
english.csv
info_layer.altitude_title.text,Altitude info_layer.dest_time_title.text,Destination Local Time info_layer.distance_title.text,Distance to Destination Airport info_layer.speed_title.text,Ground Speed info_layer.time_title.text,Remaining Flight Timehindi.csv (saved as UTF-8 without BOM):
info_layer.altitude_title.text,ऊंचाई info_layer.dest_time_title.text,स्थानीय समय गंतव्य हवाई अड्डा info_layer.distance_title.text,गंतव्य हवाई अड्डे से दूरी info_layer.speed_title.text,जमीन के ऊपर गति info_layer.time_title.text,शेष उड़ान समयlanguage.lua
local csv = require "csv" function LoadLanguage(fname) local data = {} local f = csv.open(gre.SCRIPT_ROOT.."/../translations/"..fname) for fields in f:lines() do local key = fields[1] local value = fields[2] if key and value then data[key] = value end end return data end function CBLoadLanguage(mapargs) local lang_data = LoadLanguage(mapargs.lang_file) gre.set_data(lang_data) endI call it like this:
CBLoadLanguage({ lang_file = "hindi.csv" })The Problem:
-
When I load english.csv, everything works fine.
-
When I load hindi.csv, the screen goes blank (no text).
I already saved the file in UTF-8 without BOM, so encoding should be fine. Could this be a font issue (e.g., default font doesn’t support Devanagari characters)?
My Questions:
-
How can I fix the Hindi translation issue so it displays properly instead of showing a blank screen?
-
Do I need to use a special font (like Noto Sans Devanagari)?
-
Do I need to change any Storyboard settings to support Unicode/Devanagari?
-
-
Is using separate CSV files per language the recommended approach (english.csv, hindi.csv), or should I use one CSV with multiple language columns?
-
If I want to add translations in different projects (not just this one), what’s the best practice or repeatable process for:
-
Organizing translation files
-
Writing Lua loaders
-
Adding language switch buttons/events
-
-
Is there a Storyboard best practice for managing fonts + translations together across multiple projects?
Goal:
I’d like a general, repeatable workflow for implementing translations (English + Hindi now, but more languages later) in Storyboard projects. Right now, I can’t even get Hindi to display, so I’d really appreciate any help 🙏
Thanks in advance!
Comments
Please sign in to leave a comment.