summaryrefslogtreecommitdiffstats
path: root/tools/linguist/lconvert/main.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'tools/linguist/lconvert/main.cpp')
-rw-r--r--tools/linguist/lconvert/main.cpp17
1 files changed, 17 insertions, 0 deletions
diff --git a/tools/linguist/lconvert/main.cpp b/tools/linguist/lconvert/main.cpp
index 52bf91f..ce17b6f 100644
--- a/tools/linguist/lconvert/main.cpp
+++ b/tools/linguist/lconvert/main.cpp
@@ -97,6 +97,9 @@ static int usage(const QStringList &args)
" Drop obsolete messages.\n\n"
" --no-finished\n"
" Drop finished messages.\n\n"
+ " --locations {absolute|relative|none}\n"
+ " Override how source code references are saved in ts files.\n"
+ " Default is absolute.\n}n"
" --no-ui-lines\n"
" Drop line numbers from references to .ui files.\n\n"
" --verbose\n"
@@ -132,6 +135,7 @@ int main(int argc, char *argv[])
bool noFinished = false;
bool verbose = false;
bool noUiLines = false;
+ Translator::LocationsType locations = Translator::DefaultLocations;
ConversionData cd;
Translator tr;
@@ -183,6 +187,17 @@ int main(int argc, char *argv[])
noObsolete = true;
} else if (args[i] == QLatin1String("-no-finished")) {
noFinished = true;
+ } else if (args[i] == QLatin1String("-locations")) {
+ if (++i >= args.size())
+ return usage(args);
+ if (args[i] == QLatin1String("none"))
+ locations = Translator::NoLocations;
+ else if (args[i] == QLatin1String("relative"))
+ locations = Translator::RelativeLocations;
+ else if (args[i] == QLatin1String("absolute"))
+ locations = Translator::AbsoluteLocations;
+ else
+ return usage(args);
} else if (args[i] == QLatin1String("-no-ui-lines")) {
noUiLines = true;
} else if (args[i] == QLatin1String("-verbose")) {
@@ -231,6 +246,8 @@ int main(int argc, char *argv[])
tr.dropTranslations();
if (noUiLines)
tr.dropUiLines();
+ if (locations != Translator::DefaultLocations)
+ tr.setLocationsType(locations);
if (!tr.save(outFileName, cd, outFormat)) {
qWarning("%s", qPrintable(cd.error()));