13 Commits

Author SHA1 Message Date
Campbell Barton
53e6803977 Cleanup: check for "BaseException" instead of "Exception"
Prefer the more generic exception type as it's possible exceptions
derive from this and not "Exception".

Also use the name 'ex' for exceptions instead of 'e'.
2023-07-30 16:14:13 +10:00
Campbell Barton
65f99397ec License headers: use SPDX-FileCopyrightText in all sources 2023-06-15 13:35:34 +10:00
Damien Picard
3f1ea280cf I18n: translate node group socket type and subtype
Node group sockets have user-exposed data types, and sometimes
subtypes for some data types (e.g. Percentage or Angle for floats).
The UI to select these types and subtypes use an operator menu with a
text depending on the current type or subtype.

This button needs to be manually translated since its label is
manually defined.

Additionally, some subtypes need to be extracted from the Property
class's RNA_ENUM_PROPERTY_SUBTYPE_NUMBER_ITEMS, so this commit also
removes Property from the extraction blacklist in
bl_extract_messages.py. This has the side effect that it introduces a
few dozens translations, which are probably not used anywhere.

Pull Request: https://projects.blender.org/blender/blender/pulls/107100
2023-05-16 14:53:28 +02:00
Damien Picard
a3a36e7f75 I18n: remove operator categories from the translation files
Many messages were no longer needed since Blender 2.80.

Those messages appeared in the operator search menu and described what
category each operator belonged to. After Blender 2.80, this was
replaced by a place in the UI from where the operator can be called.

Pull Request: https://projects.blender.org/blender/blender/pulls/107700
2023-05-15 19:53:01 +02:00
Campbell Barton
c4c1cc7cd3 Cleanup: double quotes for non-enum strings
Also use back-ticks for code-references in comments.
2023-04-18 10:51:32 +10:00
Damien Picard
cf9f3919a8 I18n: fix add-on extraction when UI code appears in __init__.py
The function which collects files to process in add-on extraction
returned only files that did not start with '_', in the case where the
add-on was a module in a directory. This excluded __init__.py, which
may very well contain UI code, so an exception is added for this case.

This change currently allows the extraction of 42 new messages.
2023-04-04 10:07:02 +02:00
Damien Picard
1d43beab84 I18n: Extract asset catalog and asset names and descriptions
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.
2023-03-21 12:41:10 +01:00
Damien Picard
c6d6a3517e I18n: extract add-on bl_info warnings
Some add-ons choose to use the `warning` field in the `bl_info`
dictionary. This is potentially useful info, which should be shown to
the user translated.

This commit extends `dump_addon_bl_info()` from the i18n utils add-on,
to add this field to the message extraction.
2023-03-13 11:19:42 +01:00
Bastien Montagne
067fc67bdd Merge branch 'blender-v3.5-release' 2023-03-07 11:06:19 +01:00
Damien Picard
38cba7a843 Cleanup: remove old AST code in I18n message extraction
Pre-Python 3.8, the string nodes in an AST were of type ast.Str.
Post, they are of type ast.Constant.

Remove the old naming.

Pull Request #105418
2023-03-07 10:41:57 +01:00
Damien Picard
2e5452ee87 I18n: do not extract messages explicitly marked as not translatable
Some UI functions have a "translate" argument, which if set to False
specifies that the message is not to be translated. This sometimes
means that it was already translated beforehands.

But many messages were still getting extracted, sometimes twice in
different contexts. Some featured errors because the arguments of
various functions would be concatenated, such as:

```
col.label(text=iface_("Branch: %s") % bpy.app.build_branch.decode('utf-8', 'replace'), translate=False)
```

which would get extracted as:

```
msgid "Branch: %sutf-8replace"
```

Pull Request #105417
2023-03-07 10:41:18 +01:00
Campbell Barton
e1ab9e352c Cleanup: autopep8 2023-03-01 22:12:18 +11:00
Sergey Sharybin
03806d0b67 Re-design of submodules used in blender.git
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
2023-02-21 16:39:58 +01:00