Support and General Use > Theming and Appearance Customization
Is it possible to import text into a .sbs file?
iPodVT:
Thanks for your reply and suggestion.
Following up with that, I looked at the contents of the english-us.lng file. I have no idea what its content format is nor what (or where) to edit into its content to implement your suggestion, and I'm not finding any related documentation. I'm not putting it on you to instruct me, but the nuts and bolts of implementing your suggestion is a total mystery to me. Is there some reasonably comprehensive documention somewhere that I'm not finding?
As well, wouldn't I have to reedit the .lng file each time it gets updated (as was the case with english-us.lng as recently as March 3)?
dconrad:
--- Quote from: rockbox_dev123 on March 11, 2023, 07:35:37 PM ---Edit the English translation file to contain the iPod's name as a string, and then use:
--- Code: ---%Sx(iPodName)
--- End code ---
To display the "translation".
8)
--- End quote ---
I'm sure this works, but I just wanted to pop in to mention I have a suspicion that changing the lang file could potentially cause an instability. For sure go for it, but if you run into any weird crashes this is the first thing to look at. I think the safest approach is to ensure that it's at the end of the file. Just wanted to mention that.
iPodVT:
Thanks.
Could I trouble you to please tell me what to add to the end of the file if my iPod's name is "my iPod"?
Also, I viewed the .lng file in a text editor. Is it my imagination or does it contain some invisible non printing characters?
Dook:
Can't call it a sane solution, but here's how I'd do it. I'd use the %St tag to get the output of a setting, then choose a setting I don't use that can have multiple values. Here, I use Line Selector Colours>Secondary Colour. Then in the theme make a viewport that will house the iPod's name, then use the following code to decide what name to use.
--- Code: ---%?if(%St(line selector end color), =,ffffff)<iPod Name One|>
%?if(%St(line selector end color), =,f7ffff)<iPod Name Two|>
%?if(%St(line selector end color), =,efffff)<iPod Name Three|>
%?if(%St(line selector end color), =,e7ffff)<iPod Name Four|>
--- End code ---
It's essentially hijacking this setting to allow us to make our own custom settings parameters for the theme. You could go to any iPod, and use the Rockbox settings to pick whatever name you wanted
iPodVT:
Thanks very much for providing this solution. I love the way it repurposes the setting in a way that is so different from its original intention. But it's not quite the solution I am hoping for. I think I need to file a new feature request for either or both of the following:
1 - The ability to specify one or more strings in a .cfg file that could be accessed as settings from a theme file. In the .cfg file it could have the setting name and setting value form of UserString N: TheActualString. These UserString settings would not need to be set or editable from within Rockbox, only from an external text editor. They could reside in any .cfg file that could be included in config.cfg with something like UserStrings: /.rockbox/UserStrings.cfg. Then the theme file could access them with %St(UserString N).
2 - The ability for a theme file to retrieve the contents of a text file, limited in length to Rockbox's string length limit. Maybe it would look something like %tf(/.rockbox/MyDeviceName.txt).
Does this seem reasonable/worthwhile?
Navigation
[0] Message Index
[*] Previous page
Go to full version