Months names translation

Hello

I’ve just noticed that Oxid CE 4.5.2 uses only English names for months. They are showed on “Order History” page for example. Is it possible to define custom language months names for different languages without changing “hard coded” English names?

Bye

Marko

in order history the output is called like [{ $order->oxorder__oxorderdate->value }] which is normally something like 2011-03-11 16:23:57

so no month-names used in code

Hi
Actually months names are used - please see the attached screenshot (… one picture … 10000000 words … :)).
I found English months names defined in two Oxid CE 4.5.2 files: datasource-min.js and jquery-ui.min.js .

I think that quickest solution would be displaying months as numbers and not months names.
Maybe there is even a present Oxid setting for this?
Any ideas?

Thanks

Marko

ok understood :

Welll this depends on the system language default setting for php, which should be english for most

the code flow is following:

  1. the view:
    account_order.php,

implents
2. the tpl file:

‘page/account/order.tpl’

which in the end outputs the date like this:

[{ $order->oxorder__oxorderdate->value|date_format:"%B %e, %Y" }]

the smarty function date_format, is a wrapper of the php function strftime,
which according to the PHP settings (most likely to be english)
returns fomatted String with locale settings of php

so you could go and extend account_order.php via a module

and alter :

public function render()

setlocale (LC_ALL, ‘de_DE’);
as first statement,
then you will see german Month Strings (it is the %B)…

[QUOTE=tmikla;70563]I think that quickest solution would be displaying months as numbers and not months names.
[/QUOTE]

well yes this would be:

[{ $order->oxorder__oxorderdate->value|date_format:"%d %e, %Y" }],

BUT this is confusing, since german people would write 31th of December like:
31.12,
english people would write
12/31

which would be ok for this date, but for 5th of April the confusion would be perfect

So, multi-language support for month names (and week days names also I presume) Is not supported and it should be a new Feature request?

Marko

I would tend to a bug, but in Azure only. Please check, if it is in Basic theme like in the attached screenshot from my shop (based on Basic).

I’ve searched through all Oxid 4.5.2 installation files for word “Oktober” (German spelling for October) and didn’t find any file that contains German translation of October.
And I found all English months names defined in two Oxid CE 4.5.2 files: datasource-min.js and jquery-ui.min.js .
Azure uses month names so I assume that developers didn’t have time to include multi-language support at this stage an it will be added in future.

Well yes, but the “October” you are referring to, also comes not from any translation file
it comes from php:

If you change the php locale to e.g. german then you will get “Oktober”

Oh - Ray was quick again :slight_smile:
https://bugs.oxid-esales.com/view.php?id=3307

yepp - Lucky luke, you know? Faster than his shadow…

[QUOTE=holgt;70685]Well yes, but the “October” you are referring to, also comes not from any translation file
it comes from php:

If you change the php locale to e.g. german then you will get “Oktober”[/QUOTE]

I’m a little bit confused now :confused:. Can you please help me change php locale to German so I can test it.
I really don’t know much about php so I wonder where will Oxid get German months names translation if I change php locale (can’t find months translations in any lang.php files) ?

so you could go and extend account_order.php via a module

and alter :

public function render()

@setlocale (LC_ALL, ‘de_DE’);
as first statement,

for quick and dirty try you might just add this statement as the first of the method.

in the end it is advisable to make a module of this, this would be the minimal and usable code for the module:

<?php
class german_account_order extends german_account_order_parent{
    public function render(){
        @setlocale (LC_ALL, 'de_DE');
        return parent::render();
    }
}

?>

save this into modules as file german_account_order.php

and in the Module settings:

account_order=>german_account_order

Thanks holgt

It is working now! I’ve just added @setlocale (LC_ALL, ‘de_DE’); in account_order.php

Thank you also for the translation.

You are welcome,

i’d rather advice you to do it the way i described below, since this will not make updates fail …