1 # $Id: openttd.desktop.translation.awk 24100 2012-04-08 14:29:31Z rubidium $
3 # This file is part of OpenTTD.
4 # OpenTTD is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2.
5 # OpenTTD is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
6 # See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with OpenTTD. If not, see <http://www.gnu.org/licenses/>.
9 # Awk script to extract translations for baseset descriptions
10 # from lang files for insertion into .obg/obs/obm files.
11 # If there is no translation, there is no output.
13 # The input file is scanned for the pattern
14 # !! <ini-key> <STR_id>
16 # The lang files (passed as variable 'langfiles') are scanned for <STR_id> and
17 # the translations are added to the output file:
18 # <ini-key>.<iso-code> = <translation>
21 # Simple insertion sort since not all AWKs have a sort implementation
28 for (i =
2; i
<= n
; i
++) {
31 while (A
[j
- 1] > hold
) {
46 while ((getline < file
) > 0) {
47 if (match($
0, "##isocode") > 0) {
49 } else if (match($
0, "^" str_id
" *:") > 0) {
50 sub("^[^:]*:", "", $
0)
52 if (lang ==
"en_GB") {
53 texts
[i
] = ini_key
" = "$
0;
55 texts
[i
] = ini_key
"." lang
" = "$
0;
62 for (i =
1; i
<= count
; i
++) {