Hello everybody,
Does anybody knows how to translate the days and months in Search Page Maker Plugin´s datepicker.
I have tried by placing this code in the hook/page_filter.php created by the plugin:
<script type="text/javascript" src="resources/moment/locale/es.js"></script>
But it inot translating to Spanish, it will always shows the months and days in English.
Translating months and days in SPM´s datepicker
Re: Translating months and days in SPM´s datepicker
try using this in the hook init
sql("SET lc_time_names=es_ES", $eo);
https://dev.mysql.com/doc/refman/8.0/en ... pport.html
Hope this works for you
sql("SET lc_time_names=es_ES", $eo);
https://dev.mysql.com/doc/refman/8.0/en ... pport.html
Hope this works for you
AppGini 22.14 - xampp 3.3.0 - PHP 7.4.30 - Summary reports - Calendar - Mass update - Messages - AppGiniHelper
Re: Translating months and days in SPM´s datepicker
for datepicker here is an example code on how to do it:
https://pt.stackoverflow.com/questions/ ... para-pt-br
https://pt.stackoverflow.com/questions/ ... para-pt-br
AppGini 22.14 - xampp 3.3.0 - PHP 7.4.30 - Summary reports - Calendar - Mass update - Messages - AppGiniHelper
Re: Translating months and days in SPM´s datepicker
Thank you very much AhmedBR,
This was all I needed to make it work, the code is different to the one of the example, but it is just a matter to add a single line of code to the one you already have. So you only need to look for the code below in the table_filter.php file (table is the name of your table), generated by SPM:
<script>
$j(function(){
//date
$j("#from-date_6 , #to-date_6 ").datetimepicker({
format: 'DD/MM/YYYY',
locale: 'es-Es'
});
$j("#from-date_6" ).on('dp.change' , function(e){
date = moment(e.date).add(1, 'month');
$j("#to-date_6 ").val(date.format('DD/MM/YYYY')).data("DateTimePicker").minDate(e.date);
});
});
</script>
The single line of code added was: locale: 'es-Es'
This was all I needed to make it work, the code is different to the one of the example, but it is just a matter to add a single line of code to the one you already have. So you only need to look for the code below in the table_filter.php file (table is the name of your table), generated by SPM:
<script>
$j(function(){
//date
$j("#from-date_6 , #to-date_6 ").datetimepicker({
format: 'DD/MM/YYYY',
locale: 'es-Es'
});
$j("#from-date_6" ).on('dp.change' , function(e){
date = moment(e.date).add(1, 'month');
$j("#to-date_6 ").val(date.format('DD/MM/YYYY')).data("DateTimePicker").minDate(e.date);
});
});
</script>
The single line of code added was: locale: 'es-Es'
Re: Translating months and days in SPM´s datepicker
Thanks for sharing the code. We'll add ability to specify locale used for datetime picker in the language.php file in future releases to make this easier.
Tip for people reaching this thread through search: To get a list of supported locales, open your AppGini app in a browser (any page) and press F12 to open the inspector, then go to the console tab and type
This should list all supported locales.
Tip for people reaching this thread through search: To get a list of supported locales, open your AppGini app in a browser (any page) and press F12 to open the inspector, then go to the console tab and type
Code: Select all
moment.locales()
AppGini plugins to add more power to your apps:
- DataTalk is an innovative AppGini plugin based on ChatGPT that allows you to interact with your AppGini database using natural language questions, without writing any SQL. Check the demo video
- Mass Update plugin: Update multiple records at once and improve your workflow efficiency.
- Check our other plugins and get a generous discount of up to 30% when buying 2 or more plugins.
Re: Translating months and days in SPM´s datepicker
That would be great Ahmad,
I think that SPM needs a translation space in language.php, because, the generated filter has some words in English. Right now, the only thing we can do is to translate everything right into the page_filter.php page itself.
I think that SPM needs a translation space in language.php, because, the generated filter has some words in English. Right now, the only thing we can do is to translate everything right into the page_filter.php page itself.
Re: Translating months and days in SPM´s datepicker
You're right. We plan to fix this in the next version of SPM. Stay tuned!
AppGini plugins to add more power to your apps:
- DataTalk is an innovative AppGini plugin based on ChatGPT that allows you to interact with your AppGini database using natural language questions, without writing any SQL. Check the demo video
- Mass Update plugin: Update multiple records at once and improve your workflow efficiency.
- Check our other plugins and get a generous discount of up to 30% when buying 2 or more plugins.