? ? Pending

User tests: Successful: Unsuccessful:

avatar richard67
richard67
14 Jun 2020

Pull Request for Issue #29595 .

Summary of Changes

See #29595 (comment).

Testing Instructions

Code review plus check diverse places where robots options appear (e.g. Global Configuration, tab "Site", section "Robots").

Expected result

The options are shown like they are specified to be used in the robots meta tag, see e.g. https://developers.google.com/search/reference/robots_meta_tag?hl=en.

They are marked in the language file by a comment as not to be translated.

Actual result

The robots option values are an inconsistent mix of upper and lowercase spelling.

They are not marked in the language file by a comment as not to be translated, so they might be translated by translation teams to anything.

Documentation Changes Required

None.

avatar richard67 richard67 - open - 14 Jun 2020
avatar richard67 richard67 - change - 14 Jun 2020
Status New Pending
avatar joomla-cms-bot joomla-cms-bot - change - 14 Jun 2020
Category Administration Language & Strings
avatar richard67
richard67 - comment - 14 Jun 2020

@wilsonge Shall we wait until this later pops up in 4.0-dev, or shall I make a PR for 4.0-dev, too?

Update: I've decided to make a PR for J4, too. Feel free to close that one if you expect merge conflicts.

avatar infograf768
infograf768 - comment - 14 Jun 2020

Note: it is important to remember that the strings values here are unrelated to the field values.

avatar brianteeman
brianteeman - comment - 14 Jun 2020

And that is why it was wrong. In this case they absolutely must be.

avatar richard67
richard67 - comment - 14 Jun 2020

Yep.

avatar Kostelano
Kostelano - comment - 14 Jun 2020

Good afternoon! In order for the match to be the correct match on all lines, I would also prefer to make changes to the language/en-GB/en-GB.mod_weblinks.ini:

MOD_WEBLINKS_FIELD_FOLLOW_DESC="Robots index - allow to follow or not."
MOD_WEBLINKS_FIELD_FOLLOW_LABEL="Follow/No Follow"
...
MOD_WEBLINKS_FIELD_VALUE_FOLLOW="Follow"
...
MOD_WEBLINKS_FIELD_VALUE_NOFOLLOW="No follow"

avatar richard67
richard67 - comment - 14 Jun 2020

@infograf768 Do we maintain the language strings for weblinks only in the weblinks repo? Or only here? Or both?

avatar richard67
richard67 - comment - 14 Jun 2020

Good afternoon! In order for the match to be the correct match on all lines, I would also prefer to make changes to the language/en-GB/en-GB.mod_weblinks.ini:

MOD_WEBLINKS_FIELD_FOLLOW_DESC="Robots index - allow to follow or not."
MOD_WEBLINKS_FIELD_FOLLOW_LABEL="Follow/No Follow"
...
MOD_WEBLINKS_FIELD_VALUE_FOLLOW="Follow"
...
MOD_WEBLINKS_FIELD_VALUE_NOFOLLOW="No follow"

@brianteeman What do you think? To me it seems to be a bit diffrent for weblinks regarding the label and description and the values. It could be ok like it is. What do you recomment?

@Kostelano It might be better to do that in a separate PR because it concerns weblinks, which

  1. was not mentioned in the issue handled by this PR, and
  2. has an own GitHub repository where it might be necessary to change the language string, too.
avatar brianteeman
brianteeman - comment - 14 Jun 2020

no idea, check the code

avatar richard67 richard67 - change - 14 Jun 2020
Labels Added: ? ?
avatar Quy Quy - test_item - 15 Jun 2020 - Tested successfully
avatar Quy
Quy - comment - 15 Jun 2020

I have tested this item successfully on cbd7192


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/29612.

avatar infograf768
infograf768 - comment - 15 Jun 2020

Looks like my comment was not understood. Lost in translation I guess.
The field is

			<field 
				name="robots"
				type="list"
				label="JFIELD_METADATA_ROBOTS_LABEL"
				description="JFIELD_METADATA_ROBOTS_DESC"
				>
				<option value="">JGLOBAL_USE_GLOBAL</option>
				<option value="index, follow">JGLOBAL_INDEX_FOLLOW</option>
				<option value="noindex, follow">JGLOBAL_NOINDEX_FOLLOW</option>
				<option value="index, nofollow">JGLOBAL_INDEX_NOFOLLOW</option>
				<option value="noindex, nofollow">JGLOBAL_NOINDEX_NOFOLLOW</option>
			</field>

What I meant is that whatever the spelling of the value of the lang strings JGLOBAL_, i.e. with caps or no caps, the correct value is inserted in the html.
It was a Note, which meant I did not oppose the patch, just made it clear what happens.

avatar richard67
richard67 - comment - 15 Jun 2020

I did understand that comment.

avatar brianteeman
brianteeman - comment - 15 Jun 2020

yes it was lost in translation

avatar C-Lodder
C-Lodder - comment - 15 Jun 2020

If these language strings shouldn't be translated, then why are they language strings in the first place?

avatar richard67
richard67 - comment - 15 Jun 2020

If these language strings shouldn't be translated, then why are they language strings in the first place?

Good question. I have no idea.

avatar brianteeman
brianteeman - comment - 15 Jun 2020

Because a mistake was made in the past

avatar infograf768
infograf768 - comment - 15 Jun 2020

Afaik it is the same for many fields.
Example:

; Database types (allows for a more descriptive label than the internal name)
MYSQL="MySQL (PDO)"
MYSQLI="MySQLi"
ORACLE="Oracle"
PGSQL="PostgreSQL (PDO)"
POSTGRESQL="PostgreSQL"
SQLITE="SQLite"

Now, let's say we do that

		<field
			name="robots"
			type="list"
			label="JFIELD_METADATA_ROBOTS_LABEL"
			default=""
			validate="options"
			>
			<option value="">index, follow</option>
			<option value="noindex, follow">noindex, follow</option>
			<option value="index, nofollow">index, nofollow</option>
			<option value="noindex, nofollow">noindex, nofollow</option>
		</field>

It does work. The drawback is that these now display as untranslated when debug language is on.

Screen Shot 2020-06-15 at 10 27 55

To get something very clean, we would need some code preventing debug lang to choke on these.

avatar richard67
richard67 - comment - 15 Jun 2020

@brianteeman @infograf768 Would it be a b/c break not to use language strings at all for the values in PHP code, and mark the language strings as deprecated for J4 in the J3 language file with a comment, and in J4 remove the strings?

avatar infograf768
infograf768 - comment - 15 Jun 2020

We do have already translate_label and translate_description in FormField.
Maybe we could add a translate_option ?

avatar richard67
richard67 - comment - 15 Jun 2020

@infograf768 I have no knowledge on form fields so would need advise for that.

avatar infograf768
infograf768 - comment - 15 Jun 2020

Would it be a b/c break not to use language strings at all for the values in PHP code

The strings are not used in php afaik, only the option values. This is what I tried to explain in my first comment.

		if ($this->params->get('robots'))
		{
			$this->document->setMetadata('robots', $this->params->get('robots'));
		}
avatar brianteeman
brianteeman - comment - 15 Jun 2020

There would be no b/c break and it would make life much easier for translators as it removes strings that appear to need translating. (especially for new translations where the count of strings to translate can be daunting)

avatar richard67
richard67 - comment - 15 Jun 2020

Sorry I was not clear. I meant change the PHP (or XML) so it uses the hardcoded values also for display of the options in the drop down instead of language strings.

avatar infograf768
infograf768 - comment - 15 Jun 2020

@richard67
This is what I did above (in the xml)
#29612 (comment)

the drawback being the debug lang

avatar richard67
richard67 - comment - 15 Jun 2020

@infograf768 I see ... well it seems we really need something to switch off translation for the option of particular fields. (Which is what I think the "translate_option" would be, right?)

avatar infograf768
infograf768 - comment - 15 Jun 2020

(Which is what I think the "translate_option" would be, right?)

Yep, if it is possible. I tried some stuff but I failed. For label, hint and description we deal with a single element and the code is easy. For options it looks more complex as it would have to be done per option.

avatar richard67
richard67 - comment - 15 Jun 2020

@infograf768 So what to do with this PR here and the other one for J4?

avatar brianteeman
brianteeman - comment - 15 Jun 2020

That really should be left to its own PR. Its a nice to have fix and doesnt
prevent this one from being merged

avatar wilsonge wilsonge - change - 15 Jun 2020
Status Pending Fixed in Code Base
Closed_Date 0000-00-00 00:00:00 2020-06-15 21:42:43
Closed_By wilsonge
avatar wilsonge wilsonge - close - 15 Jun 2020
avatar wilsonge wilsonge - merge - 15 Jun 2020
avatar wilsonge
wilsonge - comment - 15 Jun 2020

Merging on review and combined with the two good tests in #29613 (which is exactly the same PR)

avatar richard67
richard67 - comment - 15 Jun 2020

Not exactly the same ... the J4 PR has the same change also in the API language file.

Add a Comment

Login with GitHub to post a comment