Bug 164954 - Translate German variable and constant names
Summary: Translate German variable and constant names
Status: NEW
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: LibreOffice (show other bugs)
Version:
(earliest affected)
Inherited From OOo
Hardware: All All
: medium normal
Assignee: Not Assigned
URL:
Whiteboard:
Keywords: difficultyBeginner, easyHack, skillCpp, topicCleanup
Depends on:
Blocks:
 
Reported: 2025-01-30 10:15 UTC by Hossein
Modified: 2025-01-30 11:02 UTC (History)
3 users (show)

See Also:
Crash report or crash signature:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Hossein 2025-01-30 10:15:18 UTC
Background:
In the past, LibreOffice source code had many comments written in German, and to help developers around the world who do not know German to understand the code, those comments were translated to English, in tdf#39468:

Bug 39468 - translate German comments, removing redundant ones
https://bugs.documentfoundation.org/show_bug.cgi?id=39468

Description:
The task here is to find and translate variables and constant with German names to English. This renaming is a kind of refactoring, and should be done in a way that does not affect the code behavior. Therefore, you should also change any occurrence of the variable in the code. For this purpose, you may use IDE capabilities or tools like 'grep'.

These IDs are also used for bookmark references in the help contents. You have to also rename them inside help contents to make sure that the help bookmarks remain valid.

Examples:
This is an example change, which can show you what to do:

sc: translate German name in variable
https://gerrit.libreoffice.org/c/core/+/180902

If you look into sc/inc/helpids.h, you may find many other instances that need translation. The task here is not limited to this file, but this specific file is a good starting point.

It is important to know that the above IDs are also referred in help contents, as described here:

Help File XML format Basics > Defining Index, Contents, and Context Sensitivity > "hid" Branch
https://wiki.documentfoundation.org/Documentation/Understanding,_Authoring_and_Editing_Openoffice.org_Help/2#%22hid%22_Branch

Therefore, you should also do grepping inside help contents. For example:

$ git grep SC_HID_FUNC_WAHL
sc/inc/helpids.h:inline constexpr OUString HID_FUNC_WAHL = u"SC_HID_FUNC_WAHL"_ustr;

$ cd helpcontent2/
$ git grep SC_HID_FUNC_WAHL
source/text/scalc/01/04060109.xhp:<bookmark branch="hid/SC_HID_FUNC_WAHL" id="bm_id3153947" localize="false"/>

You should also change the ID(s) in helpcontent2/ folder accordingly.

Notes:
Please do not change unrelated files, like language files related to German support. The focus here is the C++ code.
Comment 1 Buovjaga 2025-01-30 11:02:47 UTC
(In reply to Hossein from comment #0)
> $ cd helpcontent2/
> $ git grep SC_HID_FUNC_WAHL
> source/text/scalc/01/04060109.xhp:<bookmark branch="hid/SC_HID_FUNC_WAHL"
> id="bm_id3153947" localize="false"/>

To achieve this, you have to add to your autogen.input

--with-help=html

See https://wiki.documentfoundation.org/Documentation/Help#How_to_send_it_back_for_approval_(via_gerrit) for how to handle the submodule and submit patches (it's different from core).

The help patch should be merged at the same time as the core patch.