跳至内容
菜单
此问题已终结
1 回复
3538 查看

Hello.


How can I change the displayed and used numerals in Odoo Arabic language from Eastern Arabic numerals into Western Arabic numerals?


Using Eastern Arabic numerals in the Arabic language are  both confusing and potentially problematic, not to mention completely unneeded.


This is what is wanted for a visual explanation:

https://pasteboard.co/CvZtWL8h7Prs.jpg


thanks very much.




形象
丢弃
编写者

To further clarify... we want to completely and fully disable the Eastern Arabic numerals and have them shown normally (Western Arabic 123).

最佳答案

Greetings!

For Odoo 16 -- or any subsequent release:

Please navigate to the following location: YourOdooProjectDirectory\addons\web\static\src\core\l10n. Once there, open the file named "localization_service.js". Finally, proceed to this section:

const NUMBERING_SYSTEMS = [
[/^ar-(sa|sy|001)$/i, "arab"],
[/^bn/i, "beng"],
[/^bo/i, "tibt"],
// [/^fa/i, "Farsi (Persian)"], // No numberingSystem found in Intl
// [/^(hi|mr|ne)/i, "Hindi"], // No numberingSystem found in Intl
// [/^my/i, "Burmese"], // No numberingSystem found in Intl
[/^pa-in/i, "guru"],
[/^ta/i, "tamldec"],
[/.*/i, "latn"],
];

 and comment out this line 

[/^ar-(sa|sy|001)$/i, "arab"],

so you have instead :

const NUMBERING_SYSTEMS = [
// [/^ar-(sa|sy|001)$/i, "arab"], //Commented
[/^bn/i, "beng"],
[/^bo/i, "tibt"],
// [/^fa/i, "Farsi (Persian)"], // No numberingSystem found in Intl
// [/^(hi|mr|ne)/i, "Hindi"], // No numberingSystem found in Intl
// [/^my/i, "Burmese"], // No numberingSystem found in Intl
[/^pa-in/i, "guru"],
[/^ta/i, "tamldec"],
[/.*/i, "latn"],
];

Now, simply restart the service without the need for an update.
FOR ODOO VERSIONS 16 AND BEYOND, THESE STEPS ARE SUFFICIENT

----------------------------------------------------------------------------------

FOR PREVIOUS VERSIONS OF ODOO:

In previous versions of Odoo, such as Odoo 13, you can achieve this by navigating to the following path: C:\Odoo16\16\addons\web\static\lib\moment\locale. Then, open the JavaScript file that corresponds to your desired language (e.g., ar_001 or ar_SY). Finally, proceed to:

var numberMap = {
'١': '1',
'٢': '2',
'٣': '3',
'٤': '4',
'٥': '5',
'٦': '6',
'٧': '7',
'٨': '8',
'٩': '9',
'٠': '0'
};

and 

var symbolMap = {
'1': '١',
'2': '٢',
'3': '٣',
'4': '٤',
'5': '٥',
'6': '٦',
'7': '٧',
'8': '٨',
'9': '٩',
'0': '٠'
};

and modify them by substituting Indian numerals with Arabic numerals, such as:

var numberMap = {
'1': '1',
'2': '2',
'3': '3',
'4': '4',
'5': '5',
'6': '6',
'7': '7',
'8': '8',
'9': '9',
'0': '0'
};

Consider giving the service a reboot. Hopefully, that will resolve the issue at hand!

形象
丢弃