lupdate(1)
β¨ lupdate β the glow-up page for your translation files β¨
okay bestie, so this is the manual for lupdate, from the General Commands Manual section, and honestly? it's the tool that keeps your translations from being a whole mess. let's get into it π
π NAME π
lupdate β update Qt Linguist translation files
π¦ SYNOPSIS π¦
lupdate [ options ] project-file
lupdate [ options ] source-files -ts ts-files
π DESCRIPTION π
This page documents the Qt Linguist Update tool for the Qt GUI toolkit. no cap, that's the whole point of it.
lupdate reads a qmake/tmake project file (a .pro file), finds the translatable strings in the specified source, header and interface files, and updates the translation files (TS files) specified in it. Then those translation files get handed to the translator, who uses Qt Linguist to read the files and insert the translations. it's giving teamwork, fr fr π«Ά
The TS file format is a simple human-readable XML format that can be used with version control systems if required. yes bestie, it plays nice with git. iconic. π
β¨ OPTIONS β¨
-disable-heuristic {sametext|similartext|number}β turn off the named merge heuristic. you can pass this multiple times if you're feeling thorough. π-extensions <ext>[,<ext>...]β only process files with the given extensions. the extension list must be separated with commas, not with whitespace. default:'ui,c,c++,cc,cpp,cxx,ch,h,h++,hh,hpp,hxx'.-helpβ display the usage and exit. short and sweet, we love that.-locations {absolute|relative|none}β specify/override how source code references are saved in TS files. default isabsolute.-no-obsoleteβ drop all obsolete strings. bye bye old stuff π-no-recursiveβ do not recursively scan the following directories.-no-sortβ do not sort contexts in TS files.-pluralonlyβ only include plural form messages.-pro <filename>β name of a.profile. useful for files with.profile syntax but a different file suffix.-recursiveβ recursively scan the following directories.-silentβ do not explain what is being done. stealth mode π§-source-language <language>[_<region>]β specify/override the language of the source strings. defaults toPOSIXif not specified and the file does not name it yet.-target-language <language>[_<region>]β specify/override the language of the translation. the target language is guessed from the file name if this option is not specified and the file contents name no language yet.-tr-function-alias <function>{+=,=}<alias>[,<function>{+=,=}<alias>]...β with+=, recognize<alias>as an alternative spelling of<function>. with=, recognize<alias>as the only spelling of<function>. seelupdate -hfor a list of available function names.-versionβ display the version oflupdateand exit.
π USAGE π
Here is an example .pro file that can be given to lupdate:
HEADERS = funnydialog.h \
wackywidget.h
SOURCES = funnydialog.cpp \
main.cpp \
wackywidget.cpp
FORMS = fancybox.ui
TRANSLATIONS = gnomovision_dk.ts \
gnomovision_fi.ts \
gnomovision_no.ts \
gnomovision_se.ts
When running lupdate on this project file, the translatable strings in all the files listed in the HEADERS, SOURCES and FORMS entries will be put in the translation files listed in the TRANSLATIONS entry. Previous translations will be reused as far as possible, and translated strings that have vanished from the source files are marked obsolete. so nothing gets thrown away unless you want it gone, which is honestly so considerate π
lupdate can also be invoked with a list of C++ source files, UI files and TS files:
lupdate *.cpp *.h *.ui -ts gnomovision_dk.ts
π SEE ALSO π
lrelease(1) and http://doc.qt.io/qt-5/qtwidgets-tools-i18n-example.html
go read those too bestie, iykyk π
and that's the whole page!! brought to you by The Qt Company Ltd., dated 18 October 2001, living under the name lupdate(1). slay, periodt. πβ¨ππ¦πΈ
π¦ where this page comes from
- ubuntu resolute: qttools5-dev-tools 5.15.18-1 Β· GPL-3.0-only WITH Qt-1.0 exception
- ubuntu stonking: qttools5-dev-tools 5.15.19-2build1 Β· GPL-3.0-only WITH Qt-1.0 exception
- Copyright (C) 2016 The Qt Company Ltd
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms