A user on Twitter pointed out that we always say "Update/Edit/Remove Index" in the right-click context menu for an index. Ideally we should name the exact type instead of just Index there. If you're wondering about the cultural history of indexes: https://en.wikipedia.org/wiki/Index_(publishing) We have seven types of indexes, so implementing this would require creating 21 new translatable strings. The Navigator also has "Delete Index", but the use there is clearer as the user is looking at a tree named "Indexes". The commands are FN_UPDATE_CUR_TOX aka .uno:UpdateCurIndex FN_EDIT_CURRENT_TOX aka .uno:EditCurIndex FN_REMOVE_CUR_TOX aka .uno:RemoveTableOf The .uno commands you will find in many .xml files defining popup menus. Their visibility in the context menu is controlled in SwTextShell::GetIdxState() of sw/source/uibase/shells/textidx.cxx SwView::GetState() of sw/source/uibase/uiview/viewstat.cxx Probably a pile of conditions would be required to satisfy this request.
The seven types are: Table of Contents, Alphabetical Index, Table of Figures, Index of Tables, User-Defined, Table of Objects, Bibliography. Concatenation might work like "Edit %1" translated to "%1 ändern" with possible issues regarding upper case. And the "User-Defined" ToC is awkward.
Kira, are you interested in this issue?
(In reply to Heiko Tietze from comment #1) > The seven types are: Table of Contents, Alphabetical Index, Table of > Figures, Index of Tables, User-Defined, Table of Objects, Bibliography. > Concatenation might work like "Edit %1" translated to "%1 ändern" with > possible issues regarding upper case. And the "User-Defined" ToC is awkward. Due to differences in languages, easy shortcuts like %1 might indeed not work.
(In reply to Heiko Tietze from comment #2) > Kira, are you interested in this issue? I'll take some time to review this, thanks.
If the ask is to create strings that would ONLY affect the labels displayed in the context menu items (I assume this means multiple labels can apply to one .uno command), then I'm not certain how to approach this. However, I can kind of see how to fix the issue by creating new .uno commands for each of the new strings, then utilizing the disableItem() method (found in sw/source/uibase/shells/textidx.cxx and sw/source/uibase/uiview/viewstat.cxx) to remove the item from the context menu if the TOXTypes do not match. Something along the lines of: if (TOXType != TOX_TABLES) { //3 new UNO commands for update/edit/remove index of tables disableItem(FN_UPDATE_CUR_TOX_TABLES) disableItem(FN_EDIT_CURRENT_TOX_TABLES) disableItem(FN_REMOVE_CUR_TOX_TABLES) } ...etc... but not sure if this is what you're looking for :)
I'm not sure, if this is even worth doing, but just wanted to bring this into discussion as it was mentioned in a public channel.
Not worth the effort for l10n (adding different labels or even UNO commands) but if we can easily change the label when the context menu pops-up it might be worth a few minutes work. Hossein, please take a look if this can be made an easyhack. IIRC we have menu dynamic labels somewhere. If not we better abstain from effort.