SimpleMachines / SMF

Simple Machines Forum — SMF in short — is free and open-source community forum software, delivering professional grade features in a package that allows you to set up your own online community within minutes!
https://www.simplemachines.org/
Other
598 stars 255 forks source link

Double strings? #6596

Closed Dzonny closed 3 years ago

Dzonny commented 3 years ago

https://github.com/SimpleMachines/SMF2.1/blob/f03f6efd1b9d3b0cd1bef571389bfbefbba5af3a/Themes/default/languages/Help.english.php#L644

We have two same strings in Help.english.php file: // The GDPR page of the EU exists in several languages; change the language code at the end of the url $helptxt['requireAgreement'] = 'This setting is recommended to be enabled in order to comply with the rules of the <a href="https://ec.europa.eu/commission/priorities/justice-and-fundamental-rights/data-protection/2018-reform-eu-data-protection-rules_en" target="_blank" rel="noopener" class="bbc_link">GDPR</a>.'; // The GDPR page of the EU exists in several languages; change the language code at the end of the url $helptxt['requirePolicyAgreement'] = 'This setting is recommended to be enabled in order to comply with the rules of the <a href="https://ec.europa.eu/commission/priorities/justice-and-fundamental-rights/data-protection/2018-reform-eu-data-protection-rules_en" target="_blank" rel="noopener" class="bbc_link">GDPR</a>.'; One of those should be removed though, I guess.

sbulen commented 3 years ago

What I think is going on here is that there are two different fields, but we desire the same help text for both.

The help text is displayed dynamically, based on the variable name, throughout SMF. If we get rid of one, the help text will disappear for that setting.

sbulen commented 3 years ago

To explain the note above - since the forms are dynamically built, we need two entries, even though the contents are the same. Otherwise, one of the following two help texts would disappear:

image

So I suggest we close this out.

Dzonny commented 3 years ago

I'm okay with the same text showing upon clicking on those icons, that's okay, I just don't understand why we need two same strings, can't we just tell the system to show one string two times for those help texts there?

Not a big deal anyway, was just wondering.

Sesquipedalian commented 3 years ago

I'm okay with the same text showing upon clicking on those icons, that's okay, I just don't understand why we need two same strings, can't we just tell the system to show one string two times for those help texts there?

Short answer: No.

Long answer: The admin help system uses the name of the setting to look up the correct $helptxt string, so we need $helptxt strings for both settings. Changing the system to do what you are asking would require a significant rewrite of the system and would increase its complexity. Moreover, the function responsible for assigning the correct $helptxt string to any given setting is a low-level and widely used one, so any such changes would require extensive testing. It'd be a huge pain to accomplish very little.