commit 4b2a68104b9488307c8c6b63a0f9bf8cad8beb67 Author: Ahmed Siam Date: Tue Jul 18 10:14:33 2023 +0300 i18n of lttoolbox patch 5 diff --git a/Makefile.am b/Makefile.am index fc4a319..7289117 100644 --- a/Makefile.am +++ b/Makefile.am @@ -17,4 +17,4 @@ test: tests/run_tests.py $(PYTHON) $< export LOCALES_DIR=$(datadir)/$(PACKAGE_NAME) -export LOCALES_DATA=$(LOCALES_DIR)/locales.dat +export LTTB_I18N_DATA=$(LOCALES_DIR)/lttoolbox.dat diff --git a/locales/Makefile.am b/locales/Makefile.am index 590e1cb..f6e57f3 100644 --- a/locales/Makefile.am +++ b/locales/Makefile.am @@ -1,7 +1,7 @@ -locales.dat: root.txt en.txt +lttoolbox.dat: root.txt en.txt genrb -d . root.txt en.txt echo root.res en.res > package_list.txt - pkgdata -p locales --mode archive -d . package_list.txt + pkgdata -p lttoolbox --mode archive -d . package_list.txt localesdir = $(LOCALES_DIR) -dist_locales_DATA = locales.dat +dist_locales_DATA = lttoolbox.dat diff --git a/lttoolbox/Makefile.am b/lttoolbox/Makefile.am index 5b9d003..f2ee178 100644 --- a/lttoolbox/Makefile.am +++ b/lttoolbox/Makefile.am @@ -29,7 +29,7 @@ lttoolboxlib = $(prefix)/lib lttoolbox_DATA = dix.dtd dix.rng dix.rnc acx.rng xsd/dix.xsd xsd/acx.xsd LDADD = liblttoolbox.la $(PTHREAD_LIBS) -AM_CPPFLAGS = -DLOCALES_DATA='"$(LOCALES_DATA)"' +AM_CPPFLAGS = -DLTTB_I18N_DATA='"$(LTTB_I18N_DATA)"' AM_LDFLAGS = -llttoolbox $(LIBXML_LIBS) $(ICU_LIBS) lt_append_SOURCES = lt_append.cc diff --git a/lttoolbox/acx.cc b/lttoolbox/acx.cc index 60c4f28..40d9388 100644 --- a/lttoolbox/acx.cc +++ b/lttoolbox/acx.cc @@ -26,7 +26,7 @@ const char* VALUE_ATTR = "value"; int32_t get_val(xmlNode* node) { - I18n i18n {LOCALES_DATA}; + I18n i18n {LTTB_I18N_DATA, "lttoolbox"}; UString s = getattr(node, VALUE_ATTR); if (s.empty()) { i18n.error("LTTB1001", {"node_doc_url", "line_number"}, @@ -43,7 +43,7 @@ int32_t get_val(xmlNode* node) std::map> readACX(const char* file) { - I18n i18n {LOCALES_DATA}; + I18n i18n {LTTB_I18N_DATA, "lttoolbox"}; std::map> acx; xmlNode* top_node = load_xml(file); for (auto char_node : children(top_node)) { diff --git a/lttoolbox/att_compiler.cc b/lttoolbox/att_compiler.cc index de786ab..09959f3 100644 --- a/lttoolbox/att_compiler.cc +++ b/lttoolbox/att_compiler.cc @@ -32,7 +32,7 @@ using namespace icu; -AttCompiler::AttCompiler(): i18n(LOCALES_DATA) +AttCompiler::AttCompiler(): i18n(LTTB_I18N_DATA, "lttoolbox") {} AttCompiler::~AttCompiler() diff --git a/lttoolbox/buffer.h b/lttoolbox/buffer.h index be1e0c6..534c884 100644 --- a/lttoolbox/buffer.h +++ b/lttoolbox/buffer.h @@ -72,7 +72,7 @@ public: */ Buffer(unsigned int const buf_size=2048) { - I18n i18n {LOCALES_DATA}; + I18n i18n {LTTB_I18N_DATA, "lttoolbox"}; if(buf_size == 0) { i18n.error("LTTB1010", {}, {}, true); diff --git a/lttoolbox/cli.cc b/lttoolbox/cli.cc index f5ee038..bf13463 100644 --- a/lttoolbox/cli.cc +++ b/lttoolbox/cli.cc @@ -61,14 +61,14 @@ void CLI::add_file_arg(std::string name, bool optional) if (!optional) min_file_args++; } -void CLI::set_epilog(std::string e) +void CLI::set_epilog(icu::UnicodeString e) { epilog = e; } void CLI::print_usage(std::ostream& out) { - I18n i18n {LOCALES_DATA}; + I18n i18n {LTTB_I18N_DATA, "lttoolbox"}; if (!prog_name.empty()) { out << prog_name; if (!version.empty()) { @@ -116,7 +116,7 @@ void CLI::print_usage(std::ostream& out) #endif out << it.desc << std::endl; } - if (!epilog.empty()) { + if (!epilog.isEmpty()) { out << epilog << std::endl; } } @@ -125,7 +125,7 @@ void CLI::print_usage(std::ostream& out) void CLI::parse_args(int argc, char* argv[]) { - I18n i18n {LOCALES_DATA}; + I18n i18n {LTTB_I18N_DATA, "lttoolbox"}; prog_name = basename(argv[0]); std::string arg_str; #if HAVE_GETOPT_LONG diff --git a/lttoolbox/cli.h b/lttoolbox/cli.h index 4ca1cff..862627e 100644 --- a/lttoolbox/cli.h +++ b/lttoolbox/cli.h @@ -34,7 +34,7 @@ private: icu::UnicodeString description; std::string version; - std::string epilog; + icu::UnicodeString epilog; std::vector options; std::vector> file_args; @@ -54,7 +54,7 @@ public: std::string arg); void add_bool_arg(char short_flag, std::string long_flag, icu::UnicodeString desc); void add_file_arg(std::string name, bool optional = true); - void set_epilog(std::string e); + void set_epilog(icu::UnicodeString e); void print_usage(std::ostream& out = std::cerr); void parse_args(int argc, char* argv[]); std::map>& get_strs(); diff --git a/lttoolbox/compiler.cc b/lttoolbox/compiler.cc index d3470a8..dd52b1e 100644 --- a/lttoolbox/compiler.cc +++ b/lttoolbox/compiler.cc @@ -26,7 +26,7 @@ #include #include -Compiler::Compiler(): i18n(LOCALES_DATA) +Compiler::Compiler(): i18n(LTTB_I18N_DATA, "lttoolbox") { } @@ -111,7 +111,7 @@ Compiler::parse(std::string const &file, UStringView dir) bool Compiler::valid(UStringView dir) const { - I18n i18n {LOCALES_DATA}; + I18n i18n {LTTB_I18N_DATA, "lttoolbox"}; const char* side = (dir == COMPILER_RESTRICTION_RL_VAL ? "right" : "left"); const std::set epsilonSymbols = alphabet.symbolsWhereLeftIs(0); const std::set spaceSymbols = alphabet.symbolsWhereLeftIs(' '); @@ -1005,7 +1005,7 @@ Compiler::procNode() } else { - I18n(LOCALES_DATA).error("LTTB1028", {"file_name", "line_number", "element_name"}, + I18n(LTTB_I18N_DATA, "lttoolbox").error("LTTB1028", {"file_name", "line_number", "element_name"}, {(char*)xmlTextReaderCurrentDoc(reader)->URL, xmlTextReaderGetParserLineNumber(reader), icu::UnicodeString(name.data())}, true); diff --git a/lttoolbox/compression.cc b/lttoolbox/compression.cc index 70ce074..0ea4564 100644 --- a/lttoolbox/compression.cc +++ b/lttoolbox/compression.cc @@ -31,7 +31,7 @@ Compression::writeByte(unsigned char byte, FILE *output) { if(fwrite_unlocked(&byte, 1, 1, output) != 1) { - I18n(LOCALES_DATA).error("LTTB1029", {}, {}, true); + I18n(LTTB_I18N_DATA, "lttoolbox").error("LTTB1029", {}, {}, true); } } @@ -42,7 +42,7 @@ Compression::readByte(FILE *input) if(fread_unlocked(&value, 1, 1, input) != 1) { // Not uncomment this code since -// I18n(LOCALES_DATA).error("LTTB1029", {}, {}, true); +// I18n(LTTB_I18N_DATA, "lttoolbox").error("LTTB1029", {}, {}, true); } return value; @@ -88,7 +88,7 @@ Compression::multibyte_write(unsigned int value, FILE *output) } else { - I18n(LOCALES_DATA).error("LTTB1030", {"value"}, {std::to_string(value).c_str()}, true); + I18n(LTTB_I18N_DATA, "lttoolbox").error("LTTB1030", {"value"}, {std::to_string(value).c_str()}, true); } } @@ -134,7 +134,7 @@ Compression::multibyte_write(unsigned int value, std::ostream &output) } else { - I18n(LOCALES_DATA).error("LTTB1030", {"value"}, {std::to_string(value).c_str()}, true); + I18n(LTTB_I18N_DATA, "lttoolbox").error("LTTB1030", {"value"}, {std::to_string(value).c_str()}, true); } } diff --git a/lttoolbox/compression.h b/lttoolbox/compression.h index 3e7ea40..4735add 100644 --- a/lttoolbox/compression.h +++ b/lttoolbox/compression.h @@ -44,7 +44,7 @@ enum TD_FEATURES : uint64_t { inline auto write_u64(FILE *out, uint64_t value) { auto rv = fwrite_unlocked(reinterpret_cast(&value), 1, sizeof(value), out); if (rv != sizeof(value)) { - I18n(LOCALES_DATA).error("LTTB1058", {}, {}, true); + I18n(LTTB_I18N_DATA, "lttoolbox").error("LTTB1058", {}, {}, true); } return rv; } @@ -78,7 +78,7 @@ inline auto write_le(Stream& out, uint64_t value) { inline auto read_u64(FILE *in) { uint64_t value = 0; if (fread_unlocked(reinterpret_cast(&value), 1, sizeof(value), in) != sizeof(value)) { - I18n(LOCALES_DATA).error("LTTB1058", {}, {}, true); + I18n(LTTB_I18N_DATA, "lttoolbox").error("LTTB1058", {}, {}, true); } return value; } diff --git a/lttoolbox/deserialiser.h b/lttoolbox/deserialiser.h index 0b99265..0c2627c 100644 --- a/lttoolbox/deserialiser.h +++ b/lttoolbox/deserialiser.h @@ -129,7 +129,7 @@ integer_type int_deserialise(std::istream &Stream_) { unsigned char SerialisedTypeSize = Stream_.get(); if (!Stream_) - I18n(LOCALES_DATA).error("LTTB1064", {"size"}, {std::to_string(sizeof(integer_type)).c_str()}, true); + I18n(LTTB_I18N_DATA, "lttoolbox").error("LTTB1064", {"size"}, {std::to_string(sizeof(integer_type)).c_str()}, true); for (; SerialisedTypeSize != 0;) { SerialisedType_ += @@ -137,7 +137,8 @@ integer_type int_deserialise(std::istream &Stream_) { << std::numeric_limits::digits * --SerialisedTypeSize; if (!Stream_) - I18n(LOCALES_DATA).error("LTTB1065", {"size"}, {std::to_string(sizeof(integer_type)).c_str()}, true); + I18n(LTTB_I18N_DATA, "lttoolbox").error("LTTB1065", {"size"}, + {std::to_string(sizeof(integer_type)).c_str()}, true); } return SerialisedType_; diff --git a/lttoolbox/expander.cc b/lttoolbox/expander.cc index 08b48a7..4f0ceed 100644 --- a/lttoolbox/expander.cc +++ b/lttoolbox/expander.cc @@ -47,7 +47,7 @@ Expander::expand(std::string const &file, UFILE* output) if(ret != 0) { - I18n(LOCALES_DATA).error("LTTB1011", {}, {}, false); + I18n(LTTB_I18N_DATA, "lttoolbox").error("LTTB1011", {}, {}, false); } xmlFreeTextReader(reader); @@ -74,7 +74,7 @@ Expander::requireEmptyError(UStringView name) { if(!xmlTextReaderIsEmptyElement(reader)) { - I18n(LOCALES_DATA).error("LTTB1016", {"line_number", "name"}, + I18n(LTTB_I18N_DATA, "lttoolbox").error("LTTB1016", {"line_number", "name"}, {xmlTextReaderGetParserLineNumber(reader), icu::UnicodeString(name.data())}, true); } } @@ -149,7 +149,7 @@ Expander::readString(UString &result, UStringView name) } else { - I18n(LOCALES_DATA).error("LTTB1018", {"line_number", "name"}, + I18n(LTTB_I18N_DATA, "lttoolbox").error("LTTB1018", {"line_number", "name"}, {xmlTextReaderGetParserLineNumber(reader), icu::UnicodeString(name.data())}, true); } } @@ -161,7 +161,8 @@ Expander::skipBlanks(UString &name) { if(!allBlanks()) { - I18n(LOCALES_DATA).error("LTTB1019", {"line_number"}, {xmlTextReaderGetParserLineNumber(reader)}, true); + I18n(LTTB_I18N_DATA, "lttoolbox").error("LTTB1019", {"line_number"}, + {xmlTextReaderGetParserLineNumber(reader)}, true); } xmlTextReaderRead(reader); name = XMLParseUtil::readName(reader); @@ -178,7 +179,7 @@ Expander::skip(UString &name, UStringView elem) { if(!allBlanks()) { - I18n(LOCALES_DATA).error("LTTB1019", {"line_number"}, {xmlTextReaderGetParserLineNumber(reader)}, true); + I18n(LTTB_I18N_DATA, "lttoolbox").error("LTTB1019", {"line_number"}, {xmlTextReaderGetParserLineNumber(reader)}, true); } xmlTextReaderRead(reader); name = XMLParseUtil::readName(reader); @@ -186,7 +187,7 @@ Expander::skip(UString &name, UStringView elem) if(name != elem) { - I18n(LOCALES_DATA).error("LTTB1020", {"line_number", "slash_element"}, + I18n(LTTB_I18N_DATA, "lttoolbox").error("LTTB1020", {"line_number", "slash_element"}, {xmlTextReaderGetParserLineNumber(reader), icu::UnicodeString(elem.data())}, true); } } @@ -308,7 +309,7 @@ Expander::requireAttribute(UStringView value, UStringView attrname, UStringView { if(value.empty()) { - I18n(LOCALES_DATA).error("LTTB1025", {"line_number", "element_name", "attr_name"}, + I18n(LTTB_I18N_DATA, "lttoolbox").error("LTTB1025", {"line_number", "element_name", "attr_name"}, {xmlTextReaderGetParserLineNumber(reader), icu::UnicodeString(elemname.data()), icu::UnicodeString(attrname.data())}, true); @@ -339,7 +340,7 @@ Expander::procEntry(UFILE* output) int ret = xmlTextReaderRead(reader); if(ret != 1) { - I18n(LOCALES_DATA).error("LTTB1026", {"line_number"}, {xmlTextReaderGetParserLineNumber(reader)}, true); + I18n(LTTB_I18N_DATA, "lttoolbox").error("LTTB1026", {"line_number"}, {xmlTextReaderGetParserLineNumber(reader)}, true); } myname = XMLParseUtil::readName(reader); } @@ -369,7 +370,8 @@ Expander::procEntry(UFILE* output) int ret = xmlTextReaderRead(reader); if(ret != 1) { - I18n(LOCALES_DATA).error("LTTB1026", {"line_number"}, {xmlTextReaderGetParserLineNumber(reader)}, true); + I18n(LTTB_I18N_DATA, "lttoolbox").error("LTTB1026", {"line_number"}, + {xmlTextReaderGetParserLineNumber(reader)}, true); } UString name = XMLParseUtil::readName(reader); skipBlanks(name); @@ -412,7 +414,7 @@ Expander::procEntry(UFILE* output) paradigm_lr.find(p) == paradigm_lr.end() && paradigm_rl.find(p) == paradigm_rl.end()) { - I18n(LOCALES_DATA).error("LTTB1023", {"line_number", "paradigm_name"}, + I18n(LTTB_I18N_DATA, "lttoolbox").error("LTTB1023", {"line_number", "paradigm_name"}, {xmlTextReaderGetParserLineNumber(reader), icu::UnicodeString(p.data())}, true); } @@ -494,7 +496,7 @@ Expander::procEntry(UFILE* output) } else { - I18n(LOCALES_DATA).error("LTTB1027", {"line_number", "element_name", "compiler_entry_element"}, + I18n(LTTB_I18N_DATA, "lttoolbox").error("LTTB1027", {"line_number", "element_name", "compiler_entry_element"}, {xmlTextReaderGetParserLineNumber(reader), icu::UnicodeString(name.data()), icu::UnicodeString(Compiler::COMPILER_ENTRY_ELEM.data())}, true); @@ -551,7 +553,7 @@ Expander::procNode(UFILE *output) } else { - I18n(LOCALES_DATA).error("LTTB1028", {"file_name", "line_number", "element_name"}, + I18n(LTTB_I18N_DATA, "lttoolbox").error("LTTB1028", {"file_name", "line_number", "element_name"}, {(char*)xmlTextReaderCurrentDoc(reader)->URL, xmlTextReaderGetParserLineNumber(reader), icu::UnicodeString(name.data())}, true); diff --git a/lttoolbox/file_utils.cc b/lttoolbox/file_utils.cc index 9f4348f..5c91843 100644 --- a/lttoolbox/file_utils.cc +++ b/lttoolbox/file_utils.cc @@ -30,7 +30,7 @@ openOutTextFile(const std::string& fname) } else { UFILE* ret = u_fopen(fname.c_str(), "wb", NULL, NULL); if (!ret) { - I18n(LOCALES_DATA).error("LTTB1031", {"file_name"}, {fname.c_str()}, true); + I18n(LTTB_I18N_DATA, "lttoolbox").error("LTTB1031", {"file_name"}, {fname.c_str()}, true); } return ret; } @@ -44,7 +44,7 @@ openOutBinFile(const std::string& fname) } else { FILE* ret = fopen(fname.c_str(), "wb"); if (!ret) { - I18n(LOCALES_DATA).error("LTTB1031", {"file_name"}, {fname.c_str()}, true); + I18n(LTTB_I18N_DATA, "lttoolbox").error("LTTB1031", {"file_name"}, {fname.c_str()}, true); } return ret; } @@ -58,7 +58,7 @@ openInBinFile(const std::string& fname) } else { FILE* ret = fopen(fname.c_str(), "rb"); if (!ret) { - I18n(LOCALES_DATA).error("LTTB1031", {"file_name"}, {fname.c_str()}, true); + I18n(LTTB_I18N_DATA, "lttoolbox").error("LTTB1031", {"file_name"}, {fname.c_str()}, true); } return ret; } @@ -102,7 +102,7 @@ readShared(FILE* input, std::set& letters, Alphabet& alpha) if (strncmp(header, HEADER_LTTOOLBOX, 4) == 0) { auto features = read_le(input); if (features >= LTF_UNKNOWN) { - I18n(LOCALES_DATA).error("LTTB1062", {}, {}, true); + I18n(LTTB_I18N_DATA, "lttoolbox").error("LTTB1062", {}, {}, true); } } else { // Old binary format diff --git a/lttoolbox/fst_processor.cc b/lttoolbox/fst_processor.cc index 4a4e9df..b4250e0 100644 --- a/lttoolbox/fst_processor.cc +++ b/lttoolbox/fst_processor.cc @@ -52,7 +52,7 @@ FSTProcessor::FSTProcessor() void FSTProcessor::streamError() { - I18n(LOCALES_DATA).error("LTTB1061", {}, {}, true); + I18n(LTTB_I18N_DATA, "lttoolbox").error("LTTB1061", {}, {}, true); } void @@ -63,7 +63,7 @@ FSTProcessor::parseICX(std::string const &file) reader = xmlReaderForFile(file.c_str(), NULL, 0); if(reader == NULL) { - I18n(LOCALES_DATA).error("LTTB1031", {"file_name"}, {icu::UnicodeString(file.c_str())}, true); + I18n(LTTB_I18N_DATA, "lttoolbox").error("LTTB1031", {"file_name"}, {icu::UnicodeString(file.c_str())}, true); } int ret = xmlTextReaderRead(reader); while(ret == 1) @@ -87,7 +87,7 @@ FSTProcessor::parseRCX(std::string const &file) reader = xmlReaderForFile(file.c_str(), NULL, 0); if(reader == NULL) { - I18n(LOCALES_DATA).error("LTTB1031", {"file_name"}, {icu::UnicodeString(file.c_str())}, true); + I18n(LTTB_I18N_DATA, "lttoolbox").error("LTTB1031", {"file_name"}, {icu::UnicodeString(file.c_str())}, true); } int ret = xmlTextReaderRead(reader); while(ret == 1) @@ -120,7 +120,7 @@ FSTProcessor::procNodeICX() } else { - I18n(LOCALES_DATA).error("LTTB1028", {"file_name", "line_number", "element_name"}, + I18n(LTTB_I18N_DATA, "lttoolbox").error("LTTB1028", {"file_name", "line_number", "element_name"}, {(char*)xmlTextReaderCurrentDoc(reader)->URL, xmlTextReaderGetParserLineNumber(reader), icu::UnicodeString(name.data())}, true); @@ -159,7 +159,7 @@ FSTProcessor::procNodeRCX() } else { - I18n(LOCALES_DATA).error("LTTB1028", {"file_name", "line_number", "element_name"}, + I18n(LTTB_I18N_DATA, "lttoolbox").error("LTTB1028", {"file_name", "line_number", "element_name"}, {(char*)xmlTextReaderCurrentDoc(reader)->URL, xmlTextReaderGetParserLineNumber(reader), icu::UnicodeString(name.data())}, true); @@ -668,7 +668,7 @@ FSTProcessor::classifyFinals() } else { - I18n(LOCALES_DATA).error("LTTB1033", {"transducer_first"}, {icu::UnicodeString(it.first.data())}, true); + I18n(LTTB_I18N_DATA, "lttoolbox").error("LTTB1033", {"transducer_first"}, {icu::UnicodeString(it.first.data())}, true); } } } @@ -907,7 +907,7 @@ FSTProcessor::compoundAnalysis(UString input_word) if(current_state.size() > MAX_COMBINATIONS) { - I18n(LOCALES_DATA).error("LTTB1034", {"input_word", "index", "char"}, + I18n(LTTB_I18N_DATA, "lttoolbox").error("LTTB1034", {"input_word", "index", "char"}, {icu::UnicodeString(input_word.data()), (int)i, val}, false); @@ -942,7 +942,7 @@ FSTProcessor::initDecompositionSymbols() && (compoundOnlyLSymbol=alphabet(u"<@compound:only-L>")) == 0 && (compoundOnlyLSymbol=alphabet(u"")) == 0) { - I18n(LOCALES_DATA).error("LTTB1035", {"symbol"}, {"<:compound:only-L>"}, false); + I18n(LTTB_I18N_DATA, "lttoolbox").error("LTTB1035", {"symbol"}, {"<:compound:only-L>"}, false); } else if(!showControlSymbols) { @@ -955,7 +955,7 @@ FSTProcessor::initDecompositionSymbols() && (compoundRSymbol=alphabet(u"<@compound:R>")) == 0 && (compoundRSymbol=alphabet(u"")) == 0) { - I18n(LOCALES_DATA).error("LTTB1035", {"symbol"}, {"<:compound:R>"}, false); + I18n(LTTB_I18N_DATA, "lttoolbox").error("LTTB1035", {"symbol"}, {"<:compound:R>"}, false); } else if(!showControlSymbols) { @@ -2327,7 +2327,7 @@ FSTProcessor::valid() const { if(initial_state.isFinal(all_finals)) { - I18n(LOCALES_DATA).error("LTTB1068", {}, {}, false); + I18n(LTTB_I18N_DATA, "lttoolbox").error("LTTB1068", {}, {}, false); return false; } else @@ -2336,7 +2336,7 @@ FSTProcessor::valid() const s.step(' '); if(s.size() != 0) { - I18n(LOCALES_DATA).error("LTTB1070", {}, {}, false); + I18n(LTTB_I18N_DATA, "lttoolbox").error("LTTB1070", {}, {}, false); return false; } } diff --git a/lttoolbox/fst_processor.h b/lttoolbox/fst_processor.h index 16dcde8..ba8b0b1 100644 --- a/lttoolbox/fst_processor.h +++ b/lttoolbox/fst_processor.h @@ -461,7 +461,7 @@ private: else { if(!max_case_insensitive_state_size_warned) { max_case_insensitive_state_size_warned = true; // only warn once - I18n(LOCALES_DATA).error("LTTB1032", {"max_case_insensitive_state_size"}, + I18n(LTTB_I18N_DATA, "lttoolbox").error("LTTB1032", {"max_case_insensitive_state_size"}, {std::to_string(max_case_insensitive_state_size).c_str()}, false); } return true; diff --git a/lttoolbox/input_file.cc b/lttoolbox/input_file.cc index 6f33f0d..3ac18d7 100644 --- a/lttoolbox/input_file.cc +++ b/lttoolbox/input_file.cc @@ -49,7 +49,7 @@ void InputFile::open_or_exit(const char* fname) { if (!open(fname)) { - I18n(LOCALES_DATA).error("LTTB1031", {"file_name"}, {fname}, true); + I18n(LTTB_I18N_DATA, "lttoolbox").error("LTTB1031", {"file_name"}, {fname}, true); } } @@ -96,17 +96,17 @@ InputFile::internal_read() if ((first & 0xF0) == 0xF0) { i += 3; if (fread_unlocked(cbuffer+1, 1, 3, infile) != 3) { - I18n(LOCALES_DATA).error("LTTB1063", {"number"}, {3}, true); + I18n(LTTB_I18N_DATA, "lttoolbox").error("LTTB1063", {"number"}, {3}, true); } } else if ((first & 0xE0) == 0xE0) { i += 2; if (fread_unlocked(cbuffer+1, 1, 2, infile) != 2) { - I18n(LOCALES_DATA).error("LTTB1063", {"number"}, {2}, true); + I18n(LTTB_I18N_DATA, "lttoolbox").error("LTTB1063", {"number"}, {2}, true); } } else if ((first & 0xC0) == 0xC0) { i += 1; if (fread_unlocked(cbuffer+1, 1, 1, infile) != 1) { - I18n(LOCALES_DATA).error("LTTB1063", {"number"}, {1}, true); + I18n(LTTB_I18N_DATA, "lttoolbox").error("LTTB1063", {"number"}, {1}, true); } } memset(ubuffer, 0, 3*sizeof(UChar)); @@ -150,7 +150,7 @@ InputFile::rewind() { if (infile != nullptr) { if (std::fseek(infile, 0, SEEK_SET) != 0) { - I18n(LOCALES_DATA).error("LTTB1036", {}, {}, true); + I18n(LTTB_I18N_DATA, "lttoolbox").error("LTTB1036", {}, {}, true); } } } @@ -225,7 +225,7 @@ InputFile::readBlank(bool readwblank) ret += c; if (c == '\\') { if (eof() || peek() == '\0') { - I18n(LOCALES_DATA).error("LTTB1037", {}, {}, true); + I18n(LTTB_I18N_DATA, "lttoolbox").error("LTTB1037", {}, {}, true); } ret += get(); } diff --git a/lttoolbox/lt_append.cc b/lttoolbox/lt_append.cc index ecd239a..1a2f592 100644 --- a/lttoolbox/lt_append.cc +++ b/lttoolbox/lt_append.cc @@ -23,7 +23,7 @@ int main(int argc, char *argv[]) { - I18n i18n {LOCALES_DATA}; + I18n i18n {LTTB_I18N_DATA, "lttoolbox"}; LtLocale::tryToSetLocale(); CLI cli(i18n.format("lt_append_desc"), PACKAGE_VERSION); cli.add_bool_arg('k', "keep", i18n.format("keep_desc")); diff --git a/lttoolbox/lt_apply_acx.cc b/lttoolbox/lt_apply_acx.cc index a1a2c99..7a2d7e1 100644 --- a/lttoolbox/lt_apply_acx.cc +++ b/lttoolbox/lt_apply_acx.cc @@ -25,7 +25,7 @@ int main(int argc, char* argv[]) { LtLocale::tryToSetLocale(); - CLI cli(I18n(LOCALES_DATA).format("lt_apply_acx_desc"), PACKAGE_VERSION); + CLI cli(I18n(LTTB_I18N_DATA, "lttoolbox").format("lt_apply_acx_desc"), PACKAGE_VERSION); cli.add_file_arg("input_file", false); cli.add_file_arg("acx_file"); cli.add_file_arg("output_file"); diff --git a/lttoolbox/lt_comp.cc b/lttoolbox/lt_comp.cc index cad6b8b..4db9a35 100644 --- a/lttoolbox/lt_comp.cc +++ b/lttoolbox/lt_comp.cc @@ -35,7 +35,7 @@ void errorFunc(void *ctx, const char *msg, ...) int main(int argc, char *argv[]) { - I18n i18n(LOCALES_DATA); + I18n i18n(LTTB_I18N_DATA, "lttoolbox"); LtLocale::tryToSetLocale(); CLI cli(i18n.format("lt_comp_desc"), PACKAGE_VERSION); cli.add_bool_arg('d', "debug", i18n.format("debug_desc")); diff --git a/lttoolbox/lt_compose.cc b/lttoolbox/lt_compose.cc index 3e23fc9..93e3aab 100644 --- a/lttoolbox/lt_compose.cc +++ b/lttoolbox/lt_compose.cc @@ -26,7 +26,7 @@ void compose(FILE* file_f, FILE* file_g, FILE* file_gf, bool f_inverted, bool g_anywhere, bool jobs) { - I18n i18n(LOCALES_DATA); + I18n i18n(LTTB_I18N_DATA, "lttoolbox"); Alphabet alph_f; std::set letters_f; std::map trans_f; @@ -60,7 +60,7 @@ compose(FILE* file_f, FILE* file_g, FILE* file_gf, bool f_inverted, bool g_anywh bool f_inverted, bool g_anywhere, UString name) { Transducer gf = f.compose(g, alph_f, alph_g, f_inverted, g_anywhere); if (gf.hasNoFinals()) { - I18n(LOCALES_DATA).error("LTTB1042", {"section_name"}, {icu::UnicodeString(name.data())}, false); + I18n(LTTB_I18N_DATA, "lttoolbox").error("LTTB1042", {"section_name"}, {icu::UnicodeString(name.data())}, false); } else { gf.minimize(); } @@ -95,7 +95,7 @@ compose(FILE* file_f, FILE* file_g, FILE* file_gf, bool f_inverted, bool g_anywh int main(int argc, char *argv[]) { - I18n i18n(LOCALES_DATA); + I18n i18n(LTTB_I18N_DATA, "lttoolbox"); LtLocale::tryToSetLocale(); CLI cli(i18n.format("lt_compose_desc"), PACKAGE_VERSION); cli.add_bool_arg('i', "inverted", i18n.format("inverted_desc")); diff --git a/lttoolbox/lt_expand.cc b/lttoolbox/lt_expand.cc index 5ef4666..6143602 100644 --- a/lttoolbox/lt_expand.cc +++ b/lttoolbox/lt_expand.cc @@ -23,7 +23,7 @@ int main(int argc, char *argv[]) { - I18n i18n {LOCALES_DATA}; + I18n i18n {LTTB_I18N_DATA, "lttoolbox"}; LtLocale::tryToSetLocale(); CLI cli(i18n.format("lt_expand"), PACKAGE_VERSION); cli.add_bool_arg('m', "keep-boundaries", i18n.format("keep_boundaries_desc")); diff --git a/lttoolbox/lt_invert.cc b/lttoolbox/lt_invert.cc index 03ddae9..0c53c14 100644 --- a/lttoolbox/lt_invert.cc +++ b/lttoolbox/lt_invert.cc @@ -22,7 +22,7 @@ int main(int argc, char* argv[]) { - I18n i18n {LOCALES_DATA}; + I18n i18n {LTTB_I18N_DATA, "lttoolbox"}; LtLocale::tryToSetLocale(); CLI cli(i18n.format("lt_invert_desc"), PACKAGE_VERSION); diff --git a/lttoolbox/lt_locale.cc b/lttoolbox/lt_locale.cc index 886972e..9169620 100644 --- a/lttoolbox/lt_locale.cc +++ b/lttoolbox/lt_locale.cc @@ -46,7 +46,7 @@ LtLocale::tryToSetLocale() return; } - I18n(LOCALES_DATA).error("LTTB1044", {}, {}, false); + I18n(LTTB_I18N_DATA, "lttoolbox").error("LTTB1044", {}, {}, false); setlocale(LC_ALL, "C"); #endif #ifdef __CYGWIN__ diff --git a/lttoolbox/lt_paradigm.cc b/lttoolbox/lt_paradigm.cc index 7d5499e..dfa1fcf 100644 --- a/lttoolbox/lt_paradigm.cc +++ b/lttoolbox/lt_paradigm.cc @@ -144,7 +144,7 @@ void process(UStringView pattern, std::map& trans, int main(int argc, char* argv[]) { - I18n i18n {LOCALES_DATA}; + I18n i18n {LTTB_I18N_DATA, "lttoolbox"}; LtLocale::tryToSetLocale(); CLI cli(i18n.format("lt_paradigm_desc"), PACKAGE_VERSION); cli.add_bool_arg('a', "analyser", i18n.format("analyser_desc")); diff --git a/lttoolbox/lt_print.cc b/lttoolbox/lt_print.cc index 2ec02a2..89fcf58 100644 --- a/lttoolbox/lt_print.cc +++ b/lttoolbox/lt_print.cc @@ -22,7 +22,7 @@ int main(int argc, char *argv[]) { - I18n i18n {LOCALES_DATA}; + I18n i18n {LTTB_I18N_DATA, "lttoolbox"}; LtLocale::tryToSetLocale(); CLI cli(i18n.format("lt_print_desc"), PACKAGE_VERSION); cli.add_bool_arg('a', "alpha", i18n.format("alpha_desc")); diff --git a/lttoolbox/lt_proc.cc b/lttoolbox/lt_proc.cc index 33844ec..cb7c6f2 100644 --- a/lttoolbox/lt_proc.cc +++ b/lttoolbox/lt_proc.cc @@ -31,7 +31,7 @@ void checkValidity(FSTProcessor const &fstp) int main(int argc, char *argv[]) { LtLocale::tryToSetLocale(); - I18n i18n {LOCALES_DATA}; + I18n i18n {LTTB_I18N_DATA, "lttoolbox"}; CLI cli(i18n.format("lt_proc_desc"), PACKAGE_VERSION); cli.add_file_arg("fst_file", false); diff --git a/lttoolbox/lt_restrict.cc b/lttoolbox/lt_restrict.cc index 48b42eb..f5f97c4 100644 --- a/lttoolbox/lt_restrict.cc +++ b/lttoolbox/lt_restrict.cc @@ -37,7 +37,7 @@ void get_symbol(const std::string& s, Alphabet& alpha, const char* prefix, int main(int argc, char* argv[]) { - I18n i18n {LOCALES_DATA}; + I18n i18n {LTTB_I18N_DATA, "lttoolbox"}; LtLocale::tryToSetLocale(); CLI cli(i18n.format("lt_restrict_desc"), PACKAGE_VERSION); diff --git a/lttoolbox/lt_tmxcomp.cc b/lttoolbox/lt_tmxcomp.cc index dbdbfb2..3f1b405 100644 --- a/lttoolbox/lt_tmxcomp.cc +++ b/lttoolbox/lt_tmxcomp.cc @@ -27,7 +27,7 @@ void endProgram(char *name) { - I18n i18n {LOCALES_DATA}; + I18n i18n {LTTB_I18N_DATA, "lttoolbox"}; if(name != NULL) { std::cout << basename(name) << " v" << PACKAGE_VERSION << ": " << i18n.format("lt_tmxcomp_desc") << std::endl; @@ -110,7 +110,7 @@ int main(int argc, char *argv[]) FILE *output = fopen(argv[argc-1], "wb"); if(!output) { - I18n(LOCALES_DATA).error("LTTB1005", {"file_name"}, {argv[2]}, true); + I18n(LTTB_I18N_DATA, "lttoolbox").error("LTTB1005", {"file_name"}, {argv[2]}, true); } c.write(output); fclose(output); diff --git a/lttoolbox/lt_tmxproc.cc b/lttoolbox/lt_tmxproc.cc index 1055e8a..fda2337 100644 --- a/lttoolbox/lt_tmxproc.cc +++ b/lttoolbox/lt_tmxproc.cc @@ -22,7 +22,7 @@ int main(int argc, char *argv[]) { - I18n i18n {LOCALES_DATA}; + I18n i18n {LTTB_I18N_DATA, "lttoolbox"}; LtLocale::tryToSetLocale(); CLI cli(i18n.format("lt_tmxproc_desc")); cli.add_file_arg("fst_file", false); diff --git a/lttoolbox/lt_trim.cc b/lttoolbox/lt_trim.cc index 09e14d6..7b1d60d 100644 --- a/lttoolbox/lt_trim.cc +++ b/lttoolbox/lt_trim.cc @@ -25,7 +25,7 @@ void trim(FILE* file_mono, FILE* file_bi, FILE* file_out, std::set match_sections) { - I18n i18n {LOCALES_DATA}; + I18n i18n {LTTB_I18N_DATA, "lttoolbox"}; Alphabet alph_mono; std::set letters_mono; std::map trans_mono; @@ -102,7 +102,7 @@ trim(FILE* file_mono, FILE* file_bi, FILE* file_out, std::set match_sec int main(int argc, char *argv[]) { - I18n i18n {LOCALES_DATA}; + I18n i18n {LTTB_I18N_DATA, "lttoolbox"}; LtLocale::tryToSetLocale(); CLI cli(i18n.format("lt_trim_desc"), PACKAGE_VERSION); cli.add_file_arg("analyser_bin_file", false); diff --git a/lttoolbox/pattern_list.cc b/lttoolbox/pattern_list.cc index 6a007f4..d3739e5 100644 --- a/lttoolbox/pattern_list.cc +++ b/lttoolbox/pattern_list.cc @@ -77,7 +77,7 @@ PatternList::beginSequence() { if(sequence) { - I18n(LOCALES_DATA).error("LTTB1047", {}, {}, true); + I18n(LTTB_I18N_DATA, "lttoolbox").error("LTTB1047", {}, {}, true); } sequence = true; sequence_data.clear(); @@ -88,7 +88,7 @@ PatternList::endSequence() { if(!sequence) { - I18n(LOCALES_DATA).error("LTTB1048", {}, {}, true); + I18n(LTTB_I18N_DATA, "lttoolbox").error("LTTB1048", {}, {}, true); } sequence = false; @@ -190,7 +190,7 @@ PatternList::insert(int id, int otherid) { if(!sequence) { - I18n(LOCALES_DATA).error("LTTB1049", {}, {}, true); + I18n(LTTB_I18N_DATA, "lttoolbox").error("LTTB1049", {}, {}, true); } sequence_id = id; diff --git a/lttoolbox/regexp_compiler.cc b/lttoolbox/regexp_compiler.cc index ecd385e..a7d9093 100644 --- a/lttoolbox/regexp_compiler.cc +++ b/lttoolbox/regexp_compiler.cc @@ -88,13 +88,13 @@ RegexpCompiler::isReserved(int const t) void RegexpCompiler::error() { - I18n(LOCALES_DATA).error("LTTB1050", {}, {}, true); + I18n(LTTB_I18N_DATA, "lttoolbox").error("LTTB1050", {}, {}, true); } void RegexpCompiler::errorConsuming(int const t) { - I18n(LOCALES_DATA).error("LTTB1050", {}, {}, true); + I18n(LTTB_I18N_DATA, "lttoolbox").error("LTTB1050", {}, {}, true); } void diff --git a/lttoolbox/serialiser.h b/lttoolbox/serialiser.h index 44d7715..a610ffa 100644 --- a/lttoolbox/serialiser.h +++ b/lttoolbox/serialiser.h @@ -30,6 +30,7 @@ #include #include #include +#include namespace { template @@ -159,7 +160,7 @@ void int_serialise(const integer_type &SerialisedType_, if (!Output) { std::stringstream what_; what_ << std::hex << /* [1] */ +compressedSize(SerialisedType_) << std::dec; - I18n(LOCALES_DATA).error("LTTB1066", {"size_a", "size_b"}, + I18n(LTTB_I18N_DATA, "lttoolbox").error("LTTB1066", {"size_a", "size_b"}, {std::to_string(sizeof(integer_type)).c_str(), what_.str().c_str()}, true); } @@ -174,7 +175,7 @@ void int_serialise(const integer_type &SerialisedType_, std::numeric_limits::digits * CompressedSize) << std::dec; - I18n(LOCALES_DATA).error("LTTB1067", {"size", "byte"}, + I18n(LTTB_I18N_DATA, "lttoolbox").error("LTTB1067", {"size", "byte"}, {std::to_string(sizeof(integer_type)).c_str(), what_.str().c_str()}, true); } } diff --git a/lttoolbox/string_utils.cc b/lttoolbox/string_utils.cc index 3eca057..3187c09 100644 --- a/lttoolbox/string_utils.cc +++ b/lttoolbox/string_utils.cc @@ -148,7 +148,7 @@ StringUtils::stoi(const UString& str) int ret; int c = u_sscanf(str.c_str(), "%d", &ret); if (c != 1) { - I18n(LOCALES_DATA).error("LTTB1060", {"type"}, {"int"}, true); + I18n(LTTB_I18N_DATA, "lttoolbox").error("LTTB1060", {"type"}, {"int"}, true); } return ret; } @@ -167,7 +167,7 @@ StringUtils::stod(const UString& str) c = 1; } if (c != 1) { - I18n(LOCALES_DATA).error("LTTB1060", {"type"}, {"float"}, true); + I18n(LTTB_I18N_DATA, "lttoolbox").error("LTTB1060", {"type"}, {"float"}, true); } return ret; } @@ -179,7 +179,7 @@ StringUtils::tolower(UStringView str) UErrorCode err = U_ZERO_ERROR; u_strToLower(buf, str.size()*2, str.data(), str.size(), NULL, &err); if (U_FAILURE(err)) { - I18n(LOCALES_DATA).error("LTTB1051", {"string", "errer_name"}, + I18n(LTTB_I18N_DATA, "lttoolbox").error("LTTB1051", {"string", "errer_name"}, {icu::UnicodeString(str.data()), u_errorName(err)}, true); } return buf; @@ -192,7 +192,7 @@ StringUtils::toupper(UStringView str) UErrorCode err = U_ZERO_ERROR; u_strToUpper(buf, str.size()*2, str.data(), str.size(), NULL, &err); if (U_FAILURE(err)) { - I18n(LOCALES_DATA).error("LTTB1052", {"string", "errer_name"}, + I18n(LTTB_I18N_DATA, "lttoolbox").error("LTTB1052", {"string", "errer_name"}, {icu::UnicodeString(str.data()), u_errorName(err)}, true); } return buf; @@ -205,7 +205,7 @@ StringUtils::totitle(UStringView str) UErrorCode err = U_ZERO_ERROR; u_strToTitle(buf, str.size()*2, str.data(), str.size(), NULL, NULL, &err); if (U_FAILURE(err)) { - I18n(LOCALES_DATA).error("LTTB1053", {"string", "errer_name"}, + I18n(LTTB_I18N_DATA, "lttoolbox").error("LTTB1053", {"string", "errer_name"}, {icu::UnicodeString(str.data()), u_errorName(err)}, true); } return buf; @@ -271,7 +271,7 @@ StringUtils::caseequal(UStringView a, UStringView b) UErrorCode err = U_ZERO_ERROR; int cmp = u_strCaseCompare(a.data(), a.size(), b.data(), b.size(), 0, &err); if (U_FAILURE(err)) { - I18n(LOCALES_DATA).error("LTTB1054", {"string_a", "string_b", "errer_name"}, + I18n(LTTB_I18N_DATA, "lttoolbox").error("LTTB1054", {"string_a", "string_b", "errer_name"}, {icu::UnicodeString(a.data()), icu::UnicodeString(b.data()), u_errorName(err)}, true); } diff --git a/lttoolbox/tmx_compiler.cc b/lttoolbox/tmx_compiler.cc index 712102d..ff1089e 100644 --- a/lttoolbox/tmx_compiler.cc +++ b/lttoolbox/tmx_compiler.cc @@ -49,7 +49,7 @@ TMXCompiler::parse(std::string const &file, UStringView lo, UStringView lm) reader = xmlReaderForFile(file.c_str(), NULL, 0); if(reader == NULL) { - I18n(LOCALES_DATA).error("LTTB1005", {"file_name"}, {file.c_str()}, true); + I18n(LTTB_I18N_DATA, "lttoolbox").error("LTTB1005", {"file_name"}, {file.c_str()}, true); } int ret = xmlTextReaderRead(reader); @@ -61,7 +61,7 @@ TMXCompiler::parse(std::string const &file, UStringView lo, UStringView lm) if(ret != 0) { - I18n(LOCALES_DATA).error("LTTB1011", {}, {}, false); + I18n(LTTB_I18N_DATA, "lttoolbox").error("LTTB1011", {}, {}, false); } xmlFreeTextReader(reader); @@ -76,7 +76,7 @@ TMXCompiler::requireEmptyError(UStringView name) { if(!xmlTextReaderIsEmptyElement(reader)) { - I18n(LOCALES_DATA).error("LTTB1016", {"line_number", "name"}, + I18n(LTTB_I18N_DATA, "lttoolbox").error("LTTB1016", {"line_number", "name"}, {xmlTextReaderGetParserLineNumber(reader), icu::UnicodeString(name.data())}, true); } } @@ -104,7 +104,8 @@ TMXCompiler::skipBlanks(UString &name) { if(!allBlanks()) { - I18n(LOCALES_DATA).error("LTTB1019", {"line_number"}, {xmlTextReaderGetParserLineNumber(reader)}, true); + I18n(LTTB_I18N_DATA, "lttoolbox").error("LTTB1019", {"line_number"}, + {xmlTextReaderGetParserLineNumber(reader)}, true); } } @@ -125,7 +126,8 @@ TMXCompiler::skip(UString &name, UStringView elem) { if(!allBlanks()) { - I18n(LOCALES_DATA).error("LTTB1019", {"line_number"}, {xmlTextReaderGetParserLineNumber(reader)}, true); + I18n(LTTB_I18N_DATA, "lttoolbox").error("LTTB1019", {"line_number"}, + {xmlTextReaderGetParserLineNumber(reader)}, true); } } xmlTextReaderRead(reader); @@ -134,7 +136,7 @@ TMXCompiler::skip(UString &name, UStringView elem) if(name != elem) { - I18n(LOCALES_DATA).error("LTTB1020", {"line_number", "slash_element"}, + I18n(LTTB_I18N_DATA, "lttoolbox").error("LTTB1020", {"line_number", "slash_element"}, {xmlTextReaderGetParserLineNumber(reader), icu::UnicodeString(elem.data())}, true); } } @@ -150,7 +152,7 @@ TMXCompiler::requireAttribute(UStringView value, UStringView attrname, UStringVi { if(value.empty()) { - I18n(LOCALES_DATA).error("LTTB1025", {"line_number", "element_name", "attr_name"}, + I18n(LTTB_I18N_DATA, "lttoolbox").error("LTTB1025", {"line_number", "element_name", "attr_name"}, {xmlTextReaderGetParserLineNumber(reader), icu::UnicodeString(elemname.data()), icu::UnicodeString(attrname.data())}, true); @@ -399,7 +401,7 @@ TMXCompiler::procNode() } else { - I18n(LOCALES_DATA).error("LTTB1028", {"file_name", "line_number", "element_name"}, + I18n(LTTB_I18N_DATA, "lttoolbox").error("LTTB1028", {"file_name", "line_number", "element_name"}, {(char*)xmlTextReaderCurrentDoc(reader)->URL, xmlTextReaderGetParserLineNumber(reader), icu::UnicodeString(name.data())}, true); diff --git a/lttoolbox/trans_exe.cc b/lttoolbox/trans_exe.cc index 2fc8d1f..a0a6e1d 100644 --- a/lttoolbox/trans_exe.cc +++ b/lttoolbox/trans_exe.cc @@ -75,7 +75,7 @@ TransExe::read(FILE *input, Alphabet const &alphabet) if (strncmp(header, HEADER_TRANSDUCER, 4) == 0) { auto features = read_le(input); if (features >= TDF_UNKNOWN) { - I18n(LOCALES_DATA).error("LTTB1059", {}, {}, true); + I18n(LTTB_I18N_DATA, "lttoolbox").error("LTTB1059", {}, {}, true); } read_weights = (features & TDF_WEIGHTS); } diff --git a/lttoolbox/transducer.cc b/lttoolbox/transducer.cc index c91aebc..cd4ebd4 100644 --- a/lttoolbox/transducer.cc +++ b/lttoolbox/transducer.cc @@ -170,7 +170,7 @@ Transducer::linkStates(int const source, int const target, } else { - I18n(LOCALES_DATA).error("LTTB1055", {"source", "target", "tag"}, {source, target, tag}, true); + I18n(LTTB_I18N_DATA, "lttoolbox").error("LTTB1055", {"source", "target", "tag"}, {source, target, tag}, true); } } @@ -293,7 +293,7 @@ Transducer::joinFinals(int const epsilon_tag) } else if(finals.size() == 0) { - I18n(LOCALES_DATA).error("LTTB1056",{}, {}, true); + I18n(LTTB_I18N_DATA, "lttoolbox").error("LTTB1056",{}, {}, true); } } @@ -589,7 +589,7 @@ Transducer::read(FILE *input, int const decalage) if (strncmp(header, HEADER_TRANSDUCER, 4) == 0) { auto features = read_le(input); if (features >= TDF_UNKNOWN) { - I18n(LOCALES_DATA).error("LTTB1059", {}, {}, true); + I18n(LTTB_I18N_DATA, "lttoolbox").error("LTTB1059", {}, {}, true); } read_weights = (features & TDF_WEIGHTS); } @@ -1092,7 +1092,7 @@ Transducer::trim(Transducer &trimmer, trimmer_preplus_next = trimmer_preplus; if(states_this_trimmed.find(current) == states_this_trimmed.end()) { - I18n(LOCALES_DATA).error("LTTB1057",{"f_src", "g_src"}, {this_src, trimmer_src}, true); + I18n(LTTB_I18N_DATA, "lttoolbox").error("LTTB1057",{"f_src", "g_src"}, {this_src, trimmer_src}, true); } int trimmed_src = states_this_trimmed[current]; @@ -1431,7 +1431,7 @@ Transducer::compose(Transducer const &g, g_src = current.second; if(states_f_g_gf.find(current) == states_f_g_gf.end()) { - I18n(LOCALES_DATA).error("LTTB1057",{"f_src", "g_src"}, {f_src, g_src}, true); + I18n(LTTB_I18N_DATA, "lttoolbox").error("LTTB1057",{"f_src", "g_src"}, {f_src, g_src}, true); } int gf_src = states_f_g_gf[current]; diff --git a/lttoolbox/xml_parse_util.cc b/lttoolbox/xml_parse_util.cc index 348f190..9f62010 100644 --- a/lttoolbox/xml_parse_util.cc +++ b/lttoolbox/xml_parse_util.cc @@ -26,7 +26,7 @@ XMLParseUtil::open_or_exit(const char* fname) { xmlTextReaderPtr reader = xmlReaderForFile(fname, NULL, 0); if (reader == NULL) { - I18n(LOCALES_DATA).error("LTTB1005", {"file_name"}, {fname}, true); + I18n(LTTB_I18N_DATA, "lttoolbox").error("LTTB1005", {"file_name"}, {fname}, true); } return reader; } diff --git a/lttoolbox/xml_walk_util.cc b/lttoolbox/xml_walk_util.cc index 85c0a67..e7cb191 100644 --- a/lttoolbox/xml_walk_util.cc +++ b/lttoolbox/xml_walk_util.cc @@ -60,7 +60,7 @@ load_xml(const char* fname) { xmlDoc* doc = xmlReadFile(fname, NULL, 0); if (doc == nullptr) { - I18n(LOCALES_DATA).error("LTTB1005", {"file_name"}, {fname}, true); + I18n(LTTB_I18N_DATA, "lttoolbox").error("LTTB1005", {"file_name"}, {fname}, true); } return xmlDocGetRootElement(doc); }