| |
115 |
115 |
set multilingual_string_offset [expr {$multilingual_string_offset + $new_offset}] |
| |
116 |
116 |
set offset_string [string range $offset_string $new_offset end] |
| |
117 |
117 |
} |
| |
118 |
118 |
|
| |
119 |
119 |
return $indices_list |
| |
120 |
120 |
} |
| |
121 |
121 |
|
| |
122 |
122 |
ad_proc lang::util::replace_temporary_tags_with_lookups { |
| |
123 |
123 |
file_list |
| |
124 |
124 |
} { |
| |
125 |
125 |
Modify the given ADP or Tcl files by replacing occurencies of message keys |
| |
126 |
126 |
with message lookups (i.e. <span>#</span>package_key.message_key# for ADP files |
| |
127 |
127 |
and [_ "package_key.message_key"] for Tcl files) and create entries in the |
| |
128 |
128 |
catalog file for each of these keys. If the short hand form <#_ Some en_US text#> |
| |
129 |
129 |
is used then the key will be autogenerated based on the text. |
| |
130 |
130 |
Returns the number of replacements done. This procedure only |
| |
131 |
131 |
reads from and writes to the catalog file specified (the en_US catalog |
| |
132 |
132 |
file per default) of the package that the files belong to, the database |
| |
133 |
133 |
is not accessed in any way. |
| |
134 |
134 |
|
| |
135 |
|
@param file_list A list of paths to adp or tcl files to do replacements in. The |
| |
|
135 |
@param file_list A list of paths to adp or Tcl files to do replacements in. The |
| |
136 |
136 |
paths should be relative to $::acs::rootdir. All files must |
| |
137 |
137 |
belong to the same package. |
| |
138 |
138 |
|
| |
139 |
139 |
@author Peter marklund (peter@collaboraid.biz) |
| |
140 |
140 |
} { |
| |
141 |
141 |
# Return if there are no files to process |
| |
142 |
142 |
if { [llength $file_list] == 0 } { |
| |
143 |
143 |
ns_log Warning "lang::util::replace_temporary_tags_with_lookups: Invoked with no files to process, returning" |
| |
144 |
144 |
return |
| |
145 |
145 |
} |
| |
146 |
146 |
|
| |
147 |
147 |
# Get package_key |
| |
148 |
148 |
set first_file [lindex $file_list 0] |
| |
149 |
149 |
if { ![regexp {/?packages/([^/]+)/} $first_file match package_key] } { |
| |
150 |
150 |
error "lang::util::replace_temporary_tags_with_lookups: Could not extract package_key from file $first_file" |
| |
151 |
151 |
} |
| |
152 |
152 |
|
| |
153 |
153 |
# Always create new keys in en_US |
| |
154 |
154 |
set locale "en_US" |
| |
155 |
155 |
|