Use GdkPoint in PAN_ITEM_TRIANGLE coord
[geeqie.git] / scripts / untranslated-text.sh
1 #!/bin/sh
2
3 #**********************************************************************
4 # Copyright (C) 2024 - The Geeqie Team
5 #
6 # Author: Colin Clark
7 #
8 # This program is free software; you can redistribute it and/or modify
9 # it under the terms of the GNU General Public License as published by
10 # the Free Software Foundation; either version 2 of the License, or
11 # (at your option) any later version.
12 #
13 # This program is distributed in the hope that it will be useful,
14 # but WITHOUT ANY WARRANTY; without even the implied warranty of
15 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16 # GNU General Public License for more details.
17 #
18 # You should have received a copy of the GNU General Public License along
19 # with this program; if not, write to the Free Software Foundation, Inc.,
20 # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
21 #**********************************************************************
22
23 ## @file
24 ## @brief Locate strings not marked for translation
25 ##
26 ## The check is not comprehensive - the exclusions make this
27 ## of limited value.
28 ##
29 ## @FIXME Strings starting with a space, or a lower-case alpha
30 ## or if there is more than one string per line, are not
31 ## checked for.
32 ##
33 ## The regex search is for a character sequence: \n
34 ## double quotes \n
35 ## upper-case alpha character \n
36 ## alpha character or space \n
37 ## printable character \n
38 ## previous character type repeated one or more times \n
39 ## double quotes
40 ##
41 ## The above sequence preceded by "_(" will not be a hit.
42 ##
43 ## $1 file to process
44 ##
45
46 omit_text_array="
47  msg
48 #define
49 #include
50 &lt
51 @brief
52 @param
53 COPYRIGHT
54 ColorSpace
55 DEBUG
56 Damien
57 ERR
58 EXIF
59 Error
60 Exif\.
61 FIXME
62 ImageLoaderType
63 LUA_
64 MonoSpace
65 N_(
66 NikonTag
67 Pause
68 PixbufRenderer
69 PluginsMenu
70 READ_
71 Separator
72 WRITE_
73 Wrap
74 \"Desktop\"
75 \"Layout\"
76 \"OK\"
77 \"Xmp\.
78 \.html
79 \/\*
80 \/\/
81 \{\"
82 _attribute
83 action_group
84 courier
85 exif_get_item
86 filter_add_if_missing
87 font_name
88 g_ascii_strcasecmp
89 g_build_filename
90 g_critical
91 g_key_file_get_
92 g_message
93 g_object
94 g_signal
95 g_str_has_suffix
96 g_strstr_len
97 g_themed_icon_new
98 g_warning
99 getenv
100 gtk_action_group_get_action
101 gtk_container_child_get
102 gtk_widget_add_accelerator
103 layout_actions
104 layout_toolbar_add
105 luaL_
106 lua_
107 memcmp
108 mouse_button_
109 options->
110 osd_template_insert
111 pango_attr
112 path_to_utf8
113 primaries_name
114 print_term
115 printf
116 return g_strdup
117 runcmd
118 setenv
119 signal_
120 signals_
121 strcmp
122 strncmp
123 trc_name
124 website-label
125 write_char_option
126
127 ##cellrendericon.cc
128 \"Background color as a GdkRGBA\"\,
129 \"Background color\"\,
130 \"Background set\"\,
131 \"Draw focus indicator\"\,
132 \"Fixed height\"\,
133 \"Fixed width\"\,
134 \"Focus\"\,
135 \"Foreground color as a GdkRGBA\"\,
136 \"Foreground color\"\,
137 \"Foreground set\"\,
138 \"GQvCellRendererIcon\"\,
139 \"Height of icon excluding text\"\,
140 \"Marks bit array\"\,
141 \"Marks\"\,
142 \"Number of marks\"\,
143 \"Pixbuf Object\"\,
144 \"Show marks\"\,
145 \"Show text\"\,
146 \"Text to render\"\,
147 \"Text\"\,
148 \"The pixbuf to render\"\,
149 \"Toggled mark\"\,
150 \"Whether the marks are displayed\"\,
151 \"Whether the text is displayed\"\,
152 \"Whether this tag affects the background color\"\,
153 \"Whether this tag affects the foreground color\"\,
154 \"Width of cell\"\,
155
156 ##pixbuf-renderer.cc
157 \"Delay image update\"\,
158 \"Display cache size MiB\"\,
159 \"Expand image in autozoom.\"\,
160 \"Fit window to image size\"\,
161 \"Image actively loading\"\,
162 \"Image rendering complete\"\,
163 \"Limit size of image when autofitting\"\,
164 \"Limit size of parent window\"\,
165 \"New image scroll reset\"\,
166 \"Number of tiles to retain in memory at any one time.\"\,
167 \"Size increase limit of image when autofitting\"\,
168 \"Size limit of image when autofitting\"\,
169 \"Size limit of parent window\"\,
170 \"Tile cache count\"\,
171 \"Zoom maximum\"\,
172 \"Zoom minimum\"\,
173 \"Zoom quality\"\,
174
175 ##print.cc
176 G_CALLBACK(print_set_font_cb)\, const_cast<char \*>(\"Image text font\"));
177 G_CALLBACK(print_set_font_cb)\, const_cast<char \*>(\"Page text font\"));
178
179 ##remote.cc
180 render_intent = g_strdup(\"Absolute Colorimetric\");
181 render_intent = g_strdup(\"Absolute Colorimetric\");
182 render_intent = g_strdup(\"Perceptual\");
183 render_intent = g_strdup(\"Relative Colorimetric\");
184 render_intent = g_strdup(\"Saturation\");
185 "
186
187 exclude_files_array="
188 exif.cc
189 format-canon.cc
190 format-fuji.cc
191 format-nikon.cc
192 format-olympus.cc
193 keymap-template.cc
194 "
195
196 filename_printed="no"
197
198 omit="FILE_OK"
199 while read -r omit_file
200 do
201         if [ -n "$omit_file" ]
202         then
203                 if echo "$1" | grep --quiet "$omit_file"
204                 then
205                         omit="omit"
206                 fi
207         fi
208 done << EOF
209 $exclude_files_array
210 EOF
211
212 if [ "$omit" = "FILE_OK" ]
213 then
214         while read -r infile_line
215         do
216                 if [ -n "$infile_line" ]
217                 then
218                         omit="LINE_NOT_OK"
219                         while read -r omit_text
220                         do
221                                 if [ -n "$omit_text" ]
222                                 then
223                                         if echo "$infile_line" | grep --quiet "$omit_text"
224                                         then
225                                                 omit="omit"
226                                         fi
227                                 fi
228                         done << EOF
229 $omit_text_array
230 EOF
231                         if [ "$omit" = "LINE_NOT_OK" ]
232                         then
233                                 if [ "$filename_printed" = "no" ]
234                                 then
235                                         printf "\nfile: %s\n" "$1"
236                                         filename_printed="yes"
237                                 fi
238
239                                 no_tabs=$(echo "$infile_line" | tr -s '\t')
240                                 printf "line: %s\n" "$no_tabs"
241                         fi
242                 fi
243         done << EOF
244 $(cat --number "$1" | grep --perl-regexp '(?<!_\()"[[:upper:]]([[:lower:]]|[[:space:]])[[:print:]]+"')
245 EOF
246 fi
247
248 if [ "$filename_printed" = "yes" ]
249 then
250         exit 1
251 else
252         exit 0
253 fi