User tests: Successful: Unsuccessful:
This PR prevents saving a Content Language when its Url Language Code
is empty.
2 cases when editing or creating a Content Language
If only symbols like %
or &
are entered in the URL Language Code
field
If multibytes characters are entered when Unicode Alias
is not set to Yes
in Global Configuration.
Example while admin language is en-GB, the Greek characters αω
The Content Language is saved with an empty Url Language Code
We now get an error message.
`Status | New | ⇒ | Pending |
Category | ⇒ | Administration com_languages Language & Strings |
Labels |
Added:
?
?
|
I have tested this item
Shouldn't this be done as a validation rule in the xml ?
A horizontal dash (-) is accepted too. For example en-gb. The - is not an alphanumeric character.
Yep. The hyphen is a accepted, but only if used between alphanumeric characters. Any idea for the value of the string to reflect this?
Maybe use the same text as for aliases?
Is'nt the alias hint a bit too long and overly complex here?
JFIELD_ALIAS_DESC="The Alias will be used in the SEF URL. Leave this blank and Joomla will fill in a default value from the title. This value will depend on the SEO settings (Global Configuration->Site). <br />Using Unicode will produce UTF-8 aliases. You may also enter manually any UTF-8 character. Spaces and some forbidden characters will be changed to hyphens.<br />When using default transliteration it will produce an alias in lower case and with dashes instead of spaces. You may enter the Alias manually. Use lowercase letters and hyphens (-). No spaces or underscores are allowed. Default value will be a date and time if the title is typed in non-latin letters."
In our case, as we throw the error only when the field remains empty when saved — and Unicode Alias
is set to NO —, maybe we could simply use
COM_LANGUAGES_ERROR_SEF="The \"Url Language Code\" can't be saved. Please use only alphanumeric characters and hyphens (-)."
Shall we add that entering an hyphen alone will still trigger the error?
I think the part about unicode aliases should be added.
COM_LANGUAGES_ERROR_SEF="The \"Url Language Code\" can't be saved.<br>Please use only alphanumeric characters and hyphens (-). \"Unicode Alias\" should be set to \"Yes\" in Global Configuration to use UTF8 characters"
Quite difficult to understand all of this. I found the following explanation:
https://docs.joomla.org/International_Enhancements_for_Version_1.6#Unicode_URLs
@brianteeman
Good proposal. Modifying now.
<br>
should be<br />
Not necessary and these are also globally modified in J4 strings.
Not necessary and these are also globally modified in J4 strings.
The text in the manual should then be adjusted, see:
https://github.com/joomla/coding-standards/blob/master/manual/html.md#adding-line-breaks
It is confusing indeed.
https://www.tutorialspoint.com/What-is-the-correct-way-of-using-br-br-or-br-in-HTML
In J4 we have
9 occurences of <br />
216 occurences of <br>
It is confusing indeed.
Who is authorized to change the manual for J4?
I posted an issue and informed maintainers.
As the string value has changed, this needs new tests.
In Joomla 3 it should be
In Joomla 4 is should be
This is because joomla 4 is set to be html5 and joomla 3 is not - its an option
Simplify further?
To use UTF-8 characters, set "Unicode Alias" to "Yes" in Global Configuration.
Just to be devil's advokate here:
Based on the hint, "de-" / "-de" is a valid language code here?
I know it's not, so there should be in the hint included at least one example of the correct use of the dash like "de-DE".
Just for the "least unexperienced user / editor"...
Folks, I really start to be fed up with this PR...
Sorry that you start to fed up.
In my case, I'm simply not able to access the online help at all on my hosters installation.
That may a configuration error or the hoster simply removed the online help...
Anyway.. having at least one (or two) working examples of what should be filled in there,
is just good behaviour in case of an error... but thats just my opinion.
@jiweigert
if you enter -de
or de-
it will automatically be saved as de
and will not trigger an error.
Status | Pending | ⇒ | Ready to Commit |
RTC as we can debate many months about a slightly different value.
Thanks for testing
Status | Ready to Commit | ⇒ | Fixed in Code Base |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2020-08-30 16:39:11 |
Closed_By | ⇒ | HLeithner | |
Labels |
Added:
?
|
I'm happy with it, thanks. But another PR is of course welcome.
I have tested this item✅ successfully on 0f53eca
Joomla! 3.9.22-dev Development [ Amani ] 26-August-2020 08:12 GMT
For the sake of completeness:
A horizontal dash (-) is accepted too. For example
en-gb
. The - is not an alphanumeric character.This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/30496.