diff options
Diffstat (limited to 'src/lang.c')
-rw-r--r-- | src/lang.c | 16 |
1 files changed, 16 insertions, 0 deletions
@@ -22,6 +22,8 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ | |||
22 | 22 | ||
23 | #include "lang.h" | 23 | #include "lang.h" |
24 | #include "resources.h" | 24 | #include "resources.h" |
25 | #include "prefs.h" | ||
26 | #include "app.h" | ||
25 | 27 | ||
26 | #include <the_Foundation/sortedarray.h> | 28 | #include <the_Foundation/sortedarray.h> |
27 | #include <the_Foundation/string.h> | 29 | #include <the_Foundation/string.h> |
@@ -261,3 +263,17 @@ const char *format_Lang(const char *formatTextWithIds, ...) { | |||
261 | va_end(args); | 263 | va_end(args); |
262 | return cstr_Block(collect_Block(msg)); | 264 | return cstr_Block(collect_Block(msg)); |
263 | } | 265 | } |
266 | |||
267 | iString *timeFormatHourPreference_Lang(const char *formatMsgId) { | ||
268 | iString *str = newCStr_String(cstr_Lang(formatMsgId)); | ||
269 | translate_Lang(str); | ||
270 | if (prefs_App()->time24h) { | ||
271 | replace_String(str, "%I", "%H"); | ||
272 | replace_String(str, " %p", ""); | ||
273 | replace_String(str, "%p", ""); | ||
274 | } | ||
275 | else { | ||
276 | replace_String(str, "%H:%M", "%I:%M %p"); | ||
277 | } | ||
278 | return str; | ||
279 | } | ||