11 * @deprecated prefer _("translated") - GMQCC's -ftranslatable-strings feature
14 string language_filename(string s)
16 string fn = prvm_language;
17 if (fn == "" || fn == "dump") return s;
18 fn = strcat(s, ".", fn);
19 int fh = fopen(fn, FILE_READ);
34 STATIC_INIT(CTX_cache)
48 string c = HM_gets(CTX_cache, s);
49 if (c != "") return c;
51 int caret_ofs = strstrofs(s, "^", 0);
53 // empty (caret_ofs == 0) and one char (caret_ofs == 1) prefixes are invalid
56 int space_ofs = strstrofs(substring(s, 0, caret_ofs), " ", 0);
57 // prefixes containing a space are invalid (likely the caret is part of a color code)
58 if (space_ofs < 0 || space_ofs > caret_ofs)
59 ret = substring(s, caret_ofs + 1, -1);
62 LOG_DEBUGF("CTX(\"%s\")", s);
63 HM_sets(CTX_cache, s, ret);
68 #define ZCTX(s) strzone(CTX(s))