Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[settings] There are no text strings in Transifex #30941

Closed
Valdnet opened this issue Jan 31, 2022 · 8 comments · Fixed by #30950
Closed

[settings] There are no text strings in Transifex #30941

Valdnet opened this issue Jan 31, 2022 · 8 comments · Fixed by #30950
Assignees
Labels
3. to review Waiting for reviews 23-feedback Feedback from 23.x releases feature: language l10n and translations
Milestone

Comments

@Valdnet
Copy link
Contributor

Valdnet commented Jan 31, 2022

The following text strings do not appear in Transifex. I can't find them in the source code. Where are they downloaded from?

obraz
They apply to the "core" module.

@rakekniven do you know anything about it?

@tcitworld
Copy link
Member

These strings can be found here

if (
empty($status['opcache_statistics']['max_cached_keys']) ||
($status['opcache_statistics']['num_cached_keys'] / $status['opcache_statistics']['max_cached_keys'] > 0.9)
) {
$recommendations[] = 'The maximum number of OPcache keys is nearly exceeded. To assure that all scripts can be hold in cache, it is recommended to apply <code>opcache.max_accelerated_files</code> to your PHP configuration with a value higher than <code>' . ($this->iniGetWrapper->getNumeric('opcache.max_accelerated_files') ?: 'currently') . '</code>.';
}
if (
empty($status['memory_usage']['free_memory']) ||
($status['memory_usage']['used_memory'] / $status['memory_usage']['free_memory'] > 9)
) {
$recommendations[] = 'The OPcache buffer is nearly full. To assure that all scripts can be hold in cache, it is recommended to apply <code>opcache.memory_consumption</code> to your PHP configuration with a value higher than <code>' . ($this->iniGetWrapper->getNumeric('opcache.memory_consumption') ?: 'currently') . '</code>.';
}
if (
empty($status['interned_strings_usage']['free_memory']) ||
($status['interned_strings_usage']['used_memory'] / $status['interned_strings_usage']['free_memory'] > 9)
) {
$recommendations[] = 'The OPcache interned strings buffer is nearly full. To assure that repeating strings can be effectively cached, it is recommended to apply <code>opcache.interned_strings_buffer</code> to your PHP configuration with a value higher than <code>' . ($this->iniGetWrapper->getNumeric('opcache.interned_strings_buffer') ?: 'currently') . '</code>.';
}

@Valdnet
Copy link
Contributor Author

Valdnet commented Jan 31, 2022

@tcitworld Thanks for pointing out the place 😉.

@MichaIng The code should be changed so that it can be translated.

@Valdnet Valdnet changed the title [core] There are no text strings in Transifex [settings] There are no text strings in Transifex Jan 31, 2022
@MichaIng
Copy link
Member

MichaIng commented Jan 31, 2022

Makes sense. This is done by wrapping the string into $this->l10n->t('string', [$var1, $var2, ...]), right? In case of the settings values, the <code> tag can be added to the variable, but how to do best with e.g. <code>opcache.max_accelerated_files</code> within the text? Making code+endtags variables themselves, making the whole <code>opcache.max_accelerated_files</code> a variable or just leaving it literally in the string to be translated? Second way seems to be most reasonable to me, currently.

@MichaIng MichaIng added the 2. developing Work in progress label Jan 31, 2022
@MichaIng MichaIng self-assigned this Jan 31, 2022
@MichaIng MichaIng added this to the Nextcloud 24 milestone Jan 31, 2022
@MichaIng MichaIng added the 23-feedback Feedback from 23.x releases label Jan 31, 2022
@Valdnet
Copy link
Contributor Author

Valdnet commented Jan 31, 2022

just leaving it literally in the string to be translated?

I also think that it is better to leave it in translation. Then the translator will understand the meaning of the sentence more.

Of course, all text strings from this code should be added to the translation 😉.

@MichaIng
Copy link
Member

Is there a translation available for the single word "currently", or a "now" or something else with same meaning? This is used as fallback when for some reason the numerical value of the setting cannot be obtained. This should only be possible in case of the interned strings buffer set to zero via opcache.interned_strings_buffer=0 in which case the value is not defined at all and "currently" is shown instead in the text. In this specific case actually "0" would be a better replacement, but "currently" or "now" is a more generic fallback in case there are other cases/reasons where the numerical value cannot be obtained. I'm open for better suggestions, but when not changing something on the wording, it should be at least translated as well.

@Valdnet
Copy link
Contributor Author

Valdnet commented Jan 31, 2022

Or maybe "No data" would be good for this solution?

@MichaIng
Copy link
Member

I fear this causes questions. If really no value can be obtained, and it says "now" or "currently", I guess it has a better chance that admins check for mentioned opcache.* setting in their PHP ini files and raise whichever value they find. In the only known case where this is shown, they should find opcache.interned_strings_buffer=0 and raising this above zero is then the correct way to solve the warning, and the correct recommendation as well, considering the great benefit of the OPcache interned strings buffer, where I cannot imagine any case where not using it (giving that space back to opcache.memory_usage) would be better with Nextcloud.

MichaIng added a commit that referenced this issue Jan 31, 2022
Fixes: #30941

Signed-off-by: MichaIng <micha@dietpi.com>
@MichaIng MichaIng added 3. to review Waiting for reviews and removed 2. developing Work in progress labels Jan 31, 2022
@MichaIng
Copy link
Member

The circles app has the string now for translation: https://www.transifex.com/nextcloud/search/?q=source_text%3Anow
Could be moved to core, I guess, to make it available elsewhere?

However, I opened a PR now with the simplest possible solution, moving variables only into the parameters array, leaving HTML code and the PHP opcache.* settings in the translation string: #30950
Please review, I'm open for suggestions whether to move code/settings out of the string.

MichaIng added a commit that referenced this issue Feb 1, 2022
Fixes: #30941

Signed-off-by: MichaIng <micha@dietpi.com>
MichaIng added a commit that referenced this issue Mar 4, 2022
Fixes: #30941

Signed-off-by: MichaIng <micha@dietpi.com>
MichaIng added a commit that referenced this issue Mar 16, 2022
Fixes: #30941

Signed-off-by: MichaIng <micha@dietpi.com>
nextcloud-command pushed a commit that referenced this issue Mar 17, 2022
Fixes: #30941

Signed-off-by: MichaIng <micha@dietpi.com>
MichaIng added a commit that referenced this issue Mar 22, 2022
Fixes: #30941

Signed-off-by: MichaIng <micha@dietpi.com>
nextcloud-command pushed a commit that referenced this issue Mar 22, 2022
Fixes: #30941

Signed-off-by: MichaIng <micha@dietpi.com>
backportbot-nextcloud bot pushed a commit that referenced this issue Mar 24, 2022
Fixes: #30941

Signed-off-by: MichaIng <micha@dietpi.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
3. to review Waiting for reviews 23-feedback Feedback from 23.x releases feature: language l10n and translations
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants