Summary: | Make copyright year string a variable | ||
---|---|---|---|
Product: | LibreOffice | Reporter: | Xisco Faulí <xiscofauli> |
Component: | Linguistic | Assignee: | Edward <outlay-curfew-0u> |
Status: | ASSIGNED --- | ||
Severity: | normal | CC: | hossein, mentoring, outlay-curfew-0u, sophi, stephane.guillou, xiscofauli |
Priority: | medium | Keywords: | difficultyMedium, easyHack, skillCpp, topicCleanup |
Version: | 24.8.0.0 alpha0+ | ||
Hardware: | All | ||
OS: | All | ||
Whiteboard: | |||
Crash report or crash signature: | Regression By: |
Description
Xisco Faulí
2024-03-28 14:53:40 UTC
Thanks Xisco, confirmed as discussed in ESC. I would like to pick up this issue/bug as a newbie to LibreOffice dev. I am seeing that a VER_YEARRANGE accomplishes the desired task and is already defined in include/version.hrc. It would make sense to me to re-use that existing definition, however.... VER_YEARRANGE is suffixed with the text "by" and not all Copyright statements use this text. I am reading "...relevant for translations..." in the issue/bug description, so I suspect that it would be best to define something without "by" and then use that for for the definition of VER_YEARRANGE. This then begs the question of where it should be defined so that it can be used throughout the application. Although I understand that LibreOffice is multi-lingual, I am not seeing the text "2024" in anything I would consider a translation file. Is the copyright text actually translated? As well, I am finding 5 instances in HTML files that would benefit from the standardization of a variable for the copyright statement, but there are many other instances in TXT files and I am unaware of any mechanism to implement such a variable in a TXT files. Is this possible / desirable? I would much appreciate guidance from more folks more experienced with this application in regards to where the new definition should be so that it can be used universally. Edward: you could do a change like this: diff --git a/configure.ac b/configure.ac index 4bb5ad4d97da..6a110f62c6ab 100644 --- a/configure.ac +++ b/configure.ac @@ -520,8 +520,9 @@ AC_DEFINE_UNQUOTED(LIBO_VERSION_MICRO,$LIBO_VERSION_MICRO) AC_DEFINE_UNQUOTED(LIBO_VERSION_PATCH,$LIBO_VERSION_PATCH) git_date=`git log -1 --pretty=format:"%cd" --date=format:'%Y' 2>&/dev/null` -LIBO_THIS_YEAR=${git_date:-2024} +LIBO_THIS_YEAR=${git_date:-2025} AC_DEFINE_UNQUOTED(LIBO_THIS_YEAR,$LIBO_THIS_YEAR) +AC_SUBST(LIBO_THIS_YEAR) dnl =================================================================== dnl Product version and then changes to relevant .mk files like diff --git a/postprocess/CustomTarget_registry.mk b/postprocess/CustomTarget_registry.mk index 8a503e39862a..6c16df58ddd9 100644 --- a/postprocess/CustomTarget_registry.mk +++ b/postprocess/CustomTarget_registry.mk @@ -572,6 +572,7 @@ postprocess_main_SED := \ -e 's,$${ABOUTBOXPRODUCTVERSION},$(LIBO_VERSION_MAJOR).$(LIBO_VERSION_MINOR).$(LIBO_VERSION_MICRO).$(LIBO_VERSION_PATCH)$(LIBO_VERSION_SUFFIX),g' \ -e 's,$${ABOUTBOXPRODUCTVERSIONSUFFIX},$(LIBO_VERSION_SUFFIX_SUFFIX),g' \ -e 's,$${OOOVENDOR},$(if $(OOO_VENDOR),$(subst $(COMMA),\x2c,$(OOO_VENDOR)),The Document Foundation),g' \ + -e 's,$${LIBO_THIS_YEAR},$(LIBO_THIS_YEAR),g' \ -e 's,$${PRODUCTNAME},$(PRODUCTNAME),g' \ -e 's,$${PRODUCTVERSION},$(PRODUCTVERSION),g' \ -e 's,$${PRODUCTEXTENSION},.$(LIBO_VERSION_MICRO).$(LIBO_VERSION_PATCH)$(LIBO_VERSION_SUFFIX),g' \ diff --git a/readlicense_oo/CustomTarget_readme.mk b/readlicense_oo/CustomTarget_readme.mk index bb3b41e768a8..c4ac26073d57 100644 --- a/readlicense_oo/CustomTarget_readme.mk +++ b/readlicense_oo/CustomTarget_readme.mk @@ -44,6 +44,7 @@ $(readlicense_oo_DIR)/readme.xrm : \ endif readlicense_oo_README_SED := \ + -e 's,$${LIBO_THIS_YEAR},$(LIBO_THIS_YEAR),g' \ -e 's,$${PRODUCTNAME},$(PRODUCTNAME),g' \ -e 's,$${PRODUCTVERSION},$(LIBO_VERSION_MAJOR).$(LIBO_VERSION_MINOR),g' \ But then there is also ReplaceStringHookProc function in desktop/source/app/app.cxx which is getting product name and version etc. via utl::ConfigManager and build id via utl::Bootstrap to populate About dialog text. I'm not sure what would be the best approach for this, but I hope you can consider it. Note that compilerplugins/LICENSE.TXT seen in https://gerrit.libreoffice.org/c/core/+/164794 is part of the source and will need to be manually changed in the future as well. Thanks Buovjaga. I will take that approach and let you know if I have additional questions / issues. |