Strings built by concatenating literals and pre-processor-defined
strings would lock the code extracting them for i18n forever.
This commit 'fixes' the issue by adding some support for these cases in
the `inbetween` regex snippet part of the 'extract string' complex regex
system, to avoid the lock.
The code has no way currently to extract the value of these defines
though, so they should not be used in translated strings.
NOTE: PR !122283 should do a propoer fix to these issues, by refactoring
the string building such that only actual strings pieces get processed
by the translation code.
We had inherited Danish translation file in the repository from over a
decade ago, but it was never since then an active translation, and
therefore was never added back to the current list of known languages.
Since the file exists now and is exposed in Weblate
(translate.blender.org), language entry should be created in our
settings, such that e.g. PO files do get updated with all the others!
The previous commit introduced a new `RPT_()` macro to translate
strings which are not tooltips or regular interface elements, but
longer reports or statuses.
This commit uses the new macro to translate many strings all over the
UI.
Most of it is a simple replace from `TIP_()` or `IFACE_()` to
`RPT_()`, but there are some additional changes:
- A few translations inside `BKE_report()` are removed altogether
because they are already handled by the translation system.
- Messages inside `UI_but_disable()` are no longer translated
manually, but they are handled by a new regex in the translation
system.
Pull Request: https://projects.blender.org/blender/blender/pulls/116804
Pull Request: https://projects.blender.org/blender/blender/pulls/116804
Translation of the UI is currently split into 3 preferences:
interface, tooltips, and new data. The distinction between interface
and tooltips is currently unclear as tooltips also include a lot of
messages not displayed in the actual tooltips on mouse hover.
These include reports to the Info Editor, information in editor
headers and footers, and statuses in panels.
In order to limit the use of `TIP_()` to actual tooltips, this commit
introduces a new preference for this extra information: "Reports".
New translation macros are introduced: `RPT_()` and `CTX_RPT_()`, as
well as their equivalent for the Python API, `pgettext_rpt_()`, to be
imported as `rpt_()`.
Pull Request: https://projects.blender.org/blender/blender/pulls/116804
Extract:
- Compositor error messages.
- `bUnitDef`s were broken after cleanup commit 2b77cd726d. Since each
unit's "display name" is now preceded by a consistent "name_display"
comment, the regex which extracts the unit is greatly simplified.
It now relies on the presence of the comment instead of the struct
order.
- "Preset" menu and "Apply Preset" button from the curveprofile
template.
- Operator labels from the catalog context menu.
Disambiguate:
- "Bake Data": can mean "Which data to bake" (verb), or "The data that
were baked" (noun).
- "Cache" in the Simulation Nodes panel is a verb, not a noun.
- "Mix" in the snapping menu is a noun, not a verb.
- "Top" and "Bottom" can mean the upper part of an object or the
highest point or element of something like a menu or list.
Pull Request: https://projects.blender.org/blender/blender/pulls/115963
Khmer was added for this release and is barely translated yet (about
1%), so it's not too bad. We will ensure that the Khmer script is added
to our default font for 4.1, but this is too late for 4.0.
In !112591, nodes got the ability to group sockets into panels. The
labels for these sockets are automatically shortened if they begin
with the same text as their parent labels. For instance, "Transmission
Weight" will be shortened to just "Weight" because it is under the
"Transmission" panel.
While this is a good heuristic for English, it breaks down in
languages which do not have the same word order.
This commit adds a `.short_label()` callback to socket declarations so
that a shortened label can be explicitly declared.
It also adds two regexps to the translation script so that these new
fields can be extracted to the .po translation files. One extracts the
label with a translation context, the other without. Only the one
without context is currently in use.
The current automatic shortening logic is kept and will be used only
if a shortened label is not manually provided.
Fixes#112970: Node socket labels under panels are not shortened when
translated.
Pull Request: https://projects.blender.org/blender/blender/pulls/113070
Nodes recently gained the ability to group inputs into collapsible
panels. These were untranslated, so this commit:
- Adds the appropriate regex to extract node panels defined with
the `add_panel()` callback.
- Adds the `IFACE()` translation macro to the drawing code for the
nodes, as well as the properties.
Pull Request: https://projects.blender.org/blender/blender/pulls/112968
These four languages now have some translated strings, so time to show
them in Blender.
NOTE: effect will take place after next week's update in official
Blender builds.
This is (mainly) some cleanup in names and descriptions, since we are
not using any SVN repository anymore, and layout of working new Git
repository is quite different.
Change in sync with upcoming update of the `ui_translate` add-on.
Related to https://projects.blender.org/infrastructure/blender-projects-platform/issues/65
Remove `es_ES` language.
Rename `uz_UZ` to `uz_UZ@latin`
Rename `zh_CN` to `zh_HANS`
Rename `zh_TW` to `zh_HANT`
Add support for lowercase chars in `country` part of the locale code
(although in the end it is not needed, since `boost::locale` backend
does not supports lowercase 'country' part in locales identifiers
currently) .
Related to https://projects.blender.org/infrastructure/blender-projects-platform/issues/65
Listing the "Blender Foundation" as copyright holder implied the Blender
Foundation holds copyright to files which may include work from many
developers.
While keeping copyright on headers makes sense for isolated libraries,
Blender's own code may be refactored or moved between files in a way
that makes the per file copyright holders less meaningful.
Copyright references to the "Blender Foundation" have been replaced with
"Blender Authors", with the exception of `./extern/` since these this
contains libraries which are more isolated, any changed to license
headers there can be handled on a case-by-case basis.
Some directories in `./intern/` have also been excluded:
- `./intern/cycles/` it's own `AUTHORS` file is planned.
- `./intern/opensubdiv/`.
An "AUTHORS" file has been added, using the chromium projects authors
file as a template.
Design task: #110784
Ref !110783.
The units defined in blenkernel/intern/unit.c were extracted using a
regex which contained `NULL`. Commit 129f78eee7 converted this file to
c++, and these `NULL` were replaced with `nullptr`, breaking the
regex.
This commit changes the regex to `nullptr` as well to restore the
translations.
Pull Request: https://projects.blender.org/blender/blender/pulls/110420
The node socket extraction regexes introduced in 6d39ba7b41 suffered
from two issues:
1. the contextless name extraction would also extract socket names
which did have a context. To solve, this, use a negative lookahead
at the end of the regex, containing ".translation_context(".
2. the number of characters in a message was limited to 1, because the
_str_base component would match one or more chars after the first
one, while it should have matched zero or more.
This last issues existed before, and the fix allows the extraction of
three new messages.
Pull Request: https://projects.blender.org/blender/blender/pulls/108052
Some node sockets get their names from a "label", instead of the
declaration. These labels are not necessarily the same as the
declaration, so they need to be extracted to the translation files.
They are always in a `node_sock_label()` function. It has two args,
the second of which is the string we want to extract.
The node socket declarations use the `N_()` macro to extract the name
and description of the socket.
This is quite redundant because since the syntax is always the same,
the extraction can be done automatically from the Python translation
module using regexes.
Four new regexes are introduced in bl_i18n_utils.settings:
- one extracts contextless messages from `add_input()` and
`add_output()`, the basic socket declarations with the names;
- one does the same, but for those sockets which declare a context
through `.translation_context()`;
- one extracts descriptions and error messages;
- one extracts geometry nodes field inputs.
In addition to making the code simpler and more legible, this change
extracts a few dozen messages which were not tagged with the proper
macro.
Some language names were confirmed by native speakers to be
incorrectly spelled (Dutch and Hindi).
Two others were simply capitalized (Vietnamese and Kazakh).
Suspicions remain for other language names, see #105461 for details.
Pull Request: https://projects.blender.org/blender/blender/pulls/107707
The asset catalogs are used in Geometry nodes Add Node menu to
generate the hierarchy of submenus.
The assets themselves are used to generate the operator names in the
same menu, and their descriptions.
This commits enables extraction of this data by parsing the catalog
sidecar file, as well as opening each asset blend file to search for
assets.
Many error messages were translated when using `BKE_report()` or
`BKE_reportf()`, directly, but others were missing because they used
`WM_report()` or `WM_reportf()`.
This commit adds these two functions to the list of functions used in
the message extraction regex.
In addition, `WM_reportf()` is modified so that the format string is
translated before formatting actually occurs.
This commit implements described in the #104573.
The goal is to fix the confusion of the submodule hashes change, which are not
ideal for any of the supported git-module configuration (they are either always
visible causing confusion, or silently staged and committed, also causing
confusion).
This commit replaces submodules with a checkout of addons and addons_contrib,
covered by the .gitignore, and locale and developer tools are moved to the
main repository.
This also changes the paths:
- /release/scripts are moved to the /scripts
- /source/tools are moved to the /tools
- /release/datafiles/locale is moved to /locale
This is done to avoid conflicts when using bisect, and also allow buildbot to
automatically "recover" wgen building older or newer branches/patches.
Running `make update` will initialize the local checkout to the changed
repository configuration.
Another aspect of the change is that the make update will support Github style
of remote organization (origin remote pointing to thy fork, upstream remote
pointing to the upstream blender/blender.git).
Pull Request #104755