I want custom values for calendar pop up system window in own region language
Can add it via overrides, because i must create js file in system
media/system/js/fields/calendar-locales/en.js
or
media/system/js/fields/calendar-locales/de.js or
My employees can't control language on all site.. need IT to solve some problems with tranlations
Joomla 3.8.7
Labels |
Added:
?
|
I think this is the post you are referring to about overriding /media
https://www.babdev.com/blog/139-use-the-media-folder-allow-overridable-media
@zero-24 i don't have problem with original translations... but we creating the region languages which are many differencies between original language and region/folk language
My question is: why can't be by overrides tranlate all words (text) in whole joomla ?
@brianteeman i didn't know before about this article.. but it helps a lot :) thank you
Title |
|
||||||
Status | New | ⇒ | Discussion |
Category | ⇒ | Language & Strings |
My question is: why can't be by overrides tranlate all words (text) in whole joomla ?
question to @dgrammatiko
The simple reply is that these lang values are javascript, (would be a similar reply for TinyMce lang values).
It should be overridable through the template, if it’s not then I wrongly hardcoded it. But using php (cpu cycles) to generate json files is pretty stupid and wrong pattern imho
@zero-24 i don't have problem with original translations... but we creating the region languages which are many differencies between original language and region/folk language
You should be doing this as complete language files then and not overrides - and it will make them reusable across more than one site
@infograf768 @Mausino I've just checked the code and all the assets are overridable :
joomla-cms/layouts/joomla/form/field/calendar.php
Lines 101 to 104 in e99b38d
Just a bit of the history why we did it with a static file instead of PHP:
So although this doesn't follow the usual workflow for overriding lang strings, it is still possible, all you need to do is copy the files you need to override from media\system\fields\calendar\calendar-locales\[language code].js
to your template's js folder and then edit the strings to fit your need
It looks like it's still somewhat dependent on the thing you want to override existing in the media
directory first:
joomla-cms/libraries/joomla/form/fields/calendar.php
Lines 280 to 294 in e99b38d
If you for whatever reason wanted to have separate configs for en-GB and en-US you'd still have to create en-gb.js
and en-us.js
in /media/system/js/fields/calendar-locales
to let a template override take effect.
So you CAN override an existing file, but if you needed to add a new locale for whatever reason, you'd have to get it into the core directory first.
So you CAN override an existing file, but if you needed to add a new locale for whatever reason, you'd have to get it into the core directory first.
I propose this:
It is possible to implement for a new language pack (that would not be available through J or which js files are not yet in core) the possibility to upload/get the specific files from media/xx-XX/js/fields/calendar-locales/
. These could also be used as overrides when they exist in core.
I have tested this for en-US and it works great:
if (is_file(JPATH_ROOT . '/media/' . $tag . '/js/fields/calendar-locales/' . strtolower($tag) . '.js'))
{
$localesPath = $tag . '/fields/calendar-locales/' . strtolower($tag) . '.js';
}
The advantage of such a solution is that it would not be deleted by a J update. It can be created manually or installed by a lang pack.
@mbabker @dgrammatiko
PR proposed here: #20303
Status | Discussion | ⇒ | Closed |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2018-05-05 07:12:41 |
Closed_By | ⇒ | franz-wohlkoenig |
Closed_By | franz-wohlkoenig | ⇒ | joomla-cms-bot |
Set to "closed" on behalf of @franz-wohlkoenig by The JTracker Application at issues.joomla.org/joomla-cms/20296
What kind of problems do you have with the german or original translations?
Maybe we can fix them upstream so no need to override that yourself.
Iirc there is also a way to override the files in media but I don't know it by heart need to check that later if not somone else beat me with it ;-)