We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

Localization to french

Hi, 

i am missing something, i want to display my datepicker in french.

Here is my code :

<ej:DatePicker ID="DatePicker1" runat="server" Locale="fr-FR" ButtonText="Aujourd'hui"></ej:DatePicker>

Months are still in english.

Can anybody help me ?

Thank you

3 Replies

FP Francis Paul Antony Raj Syncfusion Team November 16, 2016 07:34 AM UTC

Hi Customer,   
   
Thanks for contacting Syncfusion Support.   
   
We think that the reason it was displayed in French is because you had missed to refer the culture file (ej.culture.fr-FR.min.js) as a script reference in your project. If so, kindly refer it in your application.   
By defining required locale text values globally in script section, you can set “button text” to all DatePicker if more than one DatePicker control is present in the page. Please refer to the below code example. 
 
<script src='<%= Page.ResolveClientUrl("~/Scripts/ej/i18n/ej.culture.fr-FR.min.js")%>' type="text/javascript"></script> 
[.aspx] 
<ej:DatePicker runat="server" ID="datepick" Locale="fr-FR"></ej:DatePicker> 
[script] 
ej.DatePicker.Locale["fr-FR"] = { //globally defined locale text          
            watermarkText: "Sélectionner une date", 
            buttonText: "Aujourd'hui", 
};     
 
For more information about localization in DatePicker, refer to https://help.syncfusion.com/aspnet/datepicker/globalization  
 
Regards, 
Francis Paul A 



GU GUYOT November 16, 2016 08:12 AM UTC

Thank you, 

it works fine now.

One more thing, on the same page i have a Treegrid. I set up Locale="fr-FR" but it stays in English. Does this JS file not works with Treegrid ?

Regards


FP Francis Paul Antony Raj Syncfusion Team November 17, 2016 11:37 AM UTC

Hi Nicolas, 
 
By using “locale” property we can apply localization to TreeGrid. To localize the headerText, we can provide the custom text in “headerText” columns property. 
You can find different localization texts from the below link  
 
Please find the code example below:  
<head>      
    <script src="Scripts/scripts/ej.culture.fr-FR.min.js"></script>  
   //The ej.localetexts.fr-FR.js file carries the “fr-FR” locale text for all the EJ controls.  
    <script src="Scripts/scripts/ej.localetexts.fr-FR.js"></script>  
</head>  
<ej:TreeGrid ID="TreeGridcontainer" runat="server"  
            Locale="fr-FR"              
            <Columns>  
                <ej:TreeGridColumn HeaderText="Nom de la tâche" Field="Name" />  
                              //  
            </Columns>  
    </ej:TreeGrid>  
Please find the locale texts for TreeGrid  
<script>  
    ej.TreeGrid.Locale["fr-FR"] = {  
                toolboxTooltipTexts: {  
                    addTool: "Ajouter",  
                    editTool: "modifier",  
                    updateTool: "Mettre à jour",  
                    deleteTool: "Effacer",  
                    cancelTool: "Annuler",  
                    expandAllTool: "Développer tout",  
                    collapseAllTool: "Réduire tout",  
                    pdfExportTool: "PDF Export",  
                    excelExportTool: "export Excel"  
                },  
                contextMenuTexts: {  
                    addRowText: "Ajouter une rangée",  
                    editText: "modifier",  
                    deleteText: "Effacer",  
                    saveText: "sauvegarder",  
                    cancelText: "Annuler",  
                    aboveText: "Au dessus de",  
                    belowText: "Au dessous de"  
                },  
                columnMenuTexts: {  
                    sortAscendingText: "Trier par ordre croissant",  
                    sortDescendingText: "Trier par ordre décroissant",  
                   columnsText: "colonnes",  
                    freezeText: "Gel",  
                    unfreezeText: "Dégeler",  
                    freezePrecedingColumnsText: "Figer les colonnes antérieures à",  
                    insertColumnLeft: "Insérez la colonne de gauche",  
                    insertColumnRight: "Insérez la colonne de droite",  
                    deleteColumn: "Supprimer la colonne",  
                    renameColumn: "Renommer la colonne"  
                },  
                columnDialogTexts: {  
                    field: "Champ",  
                    headerText: "En-tête",  
                    editType: "Modifier le type",  
                    filterEditType: "Modifier le type de filtre",  
                    allowFiltering: "Autoriser le filtrage",  
                    allowFilteringBlankContent: "Autoriser le filtrage du contenu Blank",  
                    allowSorting: "Autoriser tri",  
                    visible: "Visible",  
                    width: "Largeur",  
                    textAlign: "Alignement du texte",  
                    headerTextAlign: "Alignement du texte en-tête",  
                    isFrozen: "Est gelé",  
                    allowFreezing: "Autoriser congélation",  
                    columnsDropdownData: "Colonne Chute de données vers le bas",  
                    dropdownTableText: "Texte",  
                    dropdownTableValue: "Valeur",  
                    addData: "Ajouter",  
                    deleteData: "Retirer",  
                    allowCellSelection: "Autoriser la sélection de cellules"  
                },  
                columnDialogTitle: {  
                    insertColumn: "Insérer une colonne",  
                    deleteColumn: "Supprimer la colonne",  
                    renameColumn: "Renommer la colonne"  
                },  
                deleteColumnText: "Êtes-vous sûr de vouloir supprimer cette colonne?",  
                okButtonText: "D'accord",  
                cancelButtonText: "Annuler",  
                confirmDeleteText: "Confirmation de la suppression",  
                dropDownListBlanksText: "(Vides)",  
                dropDownListClearText: "(Clear Filter)",  
                trueText: "Vrai",  
                falseText: "Faux",  
                emptyRecord: "Aucun enregistrement à afficher",  
            };  
        </script>  
We have also prepared the sample based on this. Please find the sample from below location  
 
Disclaimer: We have removed bin and obj folder in the given sample for some security reasons, we must include Syncfusion.EJ and Syncfusion.EJ.Web dlls to render the TreeGrid control which is available in Essential Studio installed location. 
 
Please let us know if you require further assistance on this. 

Regards,
Francis Paul A
   


Loader.
Up arrow icon