? ? Success

User tests: Successful: Unsuccessful:

avatar infograf768
infograf768
5 May 2018

Pull Request for Issue #20296

Summary of Changes

Let's add in a media/xx-XX/ language folder a xx-xx.js lang file for calendar on the model of what we already do for other calendar files for fa-IR for example.

Testing Instructions

Example with en-US which is normally using the en.js file from
/ROOT/media/system/js/fields/calendar-locales/en.js

Create the following hierarchy for en-US in the media folder
screen shot 2018-05-05 at 09 02 17

the en-us.js file is a copy of the en-js file where you will modify some values.
Install en-US language and switch to it in backend, edit an article, check the values you modified.

@dgrammatiko @alikon

avatar infograf768 infograf768 - open - 5 May 2018
avatar infograf768 infograf768 - change - 5 May 2018
Status New Pending
avatar joomla-cms-bot joomla-cms-bot - change - 5 May 2018
Category Libraries
avatar infograf768
infograf768 - comment - 5 May 2018

Note:
To install such file from a language pack, one has to add the folder hierarchy in the site folder part and add this in the site install xml, here for en-US

	<media destination="en-US">
		<filename>js/fields/calendar-locales/en-us.js</filename>
	</media>
avatar dgrammatiko
dgrammatiko - comment - 5 May 2018

@infograf768 you are perplexing things here imho. The old calendar (with it's language files) was on purpose left in place due to B/C and the case that someone could be using it. What you're trying to do here is mix the old way with the new. There is no need for us to fall back to a 10 year old convention. What will be far more interesting is: #19772 so we remove the edge cases for en-us and en-uk but also do it properly, eg all languages will have their own calendar strings file like el-gr.js.

avatar infograf768
infograf768 - comment - 5 May 2018

I don't think so.
On one hand, I totally disagree with #19772 and I am not alone on this.
Also old and new ways are not at stake.
This PR lets override AND add new languages xx-xx.js files when they are not proposed by core.
Example:
I make a fr-CH lang pack for my own use and some strings have to be modified: I am NOT going to propose it to be included in core and I am not going to add manually a fr-ch.js in the media/system/ folder but rather in the proper fr-CH folder in the media folder.
This simple PR let's do that easily.

avatar Bakual
Bakual - comment - 5 May 2018

@dgrammatiko For your other PR, my comments are already there in that PR. But I honestly don't see how it would solve the issue JM is trying to solve here ("overriding" a language file that isn't present in core).

There is no need for us to fall back to a 10 year old convention.

Actually, it's neither a fall back, nor are 10 year old conventions bad per se. Imho it makes sense and it is in line with how we use the media folder for other extensions as well (put extension first and then inside the extension specific files). So I don't see the issue you have with this proposal at all.
But of course if you have a better proposal for a directory structure, I'm sure it can be adopted.

avatar dgrammatiko
dgrammatiko - comment - 5 May 2018

"overriding" a language file that isn't present in core

That can be fixed with the other PR. I guess you didn't actually realise what that code can do there...

avatar infograf768
infograf768 - comment - 5 May 2018

That can be fixed with the other PR. I guess you didn't actually realise what that code can do there...

Whatever it can do (and we will test and decide later on what it really does) , this PR here is NOT for 4.0 but 3.x where this is not yet possible as stated by the author of the original Issue using customized regional languages.

avatar dgrammatiko
dgrammatiko - comment - 5 May 2018

Anyways for J4 I'll make a PR to utilise the native HTML5 date and time because most browsers already support it and it's easier to polyfill the ones (IE and Safari) that doesn't. Here's a rough preview (open it with FF): https://codepen.io/dgt41/pen/qYPZKa
Same thing for the input type="color". Let's stop trying to do our own crap implementation of things that are already widely supported from browsers these days.

But anyhow this is ok, I guess, if it will allow people to make easier overrides

avatar Bakual
Bakual - comment - 5 May 2018

Our own "crap" implementations predate the HTML5 tags and often still offer more functionality than most browsers native ones. So please don't be so harsh with previous contributions from both you and others. It paints a bad picture of you, not the others.
Of course, feel free to rewrite the calendar (yet again) for J4. Just make sure all the needed features are supported.

avatar franz-wohlkoenig
franz-wohlkoenig - comment - 12 May 2019

@infograf768 this looks like "rebase for J4".

avatar infograf768
infograf768 - comment - 12 May 2019

I guess so as no one tested and I have not seen any noticeable change in calendar in J4, except now getting 2 files per language (at least for quite a few of them) in media/, a xx.min.js one added, which is totally useless imho for such small files.

avatar infograf768 infograf768 - change - 12 May 2019
Labels Removed: J3 Issue
avatar franz-wohlkoenig
franz-wohlkoenig - comment - 12 May 2019

Closed for rebase on J4.

avatar franz-wohlkoenig franz-wohlkoenig - change - 12 May 2019
Status Pending Closed
Closed_Date 0000-00-00 00:00:00 2019-05-12 09:22:12
Closed_By franz-wohlkoenig
Labels Added: ?
avatar franz-wohlkoenig franz-wohlkoenig - close - 12 May 2019

Add a Comment

Login with GitHub to post a comment