Generating TBUF resources automatically

From Nokia Developer Wiki
Jump to: navigation, search
Article Metadata
Created: jsakkinen (15 Apr 2008)
Last edited: hamishwillee (23 Jul 2012)

The following sed-script generates TBUF-resources from file containing localized strings:

# If the line doesn't contain string declaration, skip it.
# Strip prefix.
# Strip postfix.
# Substitute to the TBUF declaration.
s/\(.*\)/RESOURCE TBUF r_\1 { buf = STRING_r_\1; }/

This script assumes that those strings that are meant to be declared as string resources are prefixed with STRING_r_.

For example, if you have rls-file:

rls_string STRING_foo_heading "Foo"
rls_string STRING_r_bar_heading "Bar"

The generated strings.rss will contain:

RESOURCE TBUF r_bar_heading { buf = STRING_r_bar_heading; }
This page was last modified on 23 July 2012, at 10:51.
14 page views in the last 30 days.