Internationalize plugin

Asked

Viewed 57 times

0

Hello! I’m using a standard jquery datatable, yet even with the charset set set set to "UTF-8" the accented translation parts are represented by: . Would anyone know a solution to fix this internationalization?

My head is like this:

<head>
 <meta charset="UTF-8">
        <meta http-equiv="X-UA-Compatible" content="IE=edge">
        <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
        <title>Categorias</title>

        <!-- Núcleo Bootstrap CSS-->
        <link href="vendor/bootstrap/css/bootstrap.min.css" rel="stylesheet">

        <!-- Customização de fontes-->
        <link href="vendor/fontawesome-free/css/all.min.css" rel="stylesheet" type="text/css">

        <!-- Page level plugin CSS-->
        <link href="vendor/datatables/dataTables.bootstrap4.css" rel="stylesheet">

        <!-- Estilo de customização do template-->
        <link href="css/sb-admin.css" rel="stylesheet">

        <script src="vendor/jquery/jquery.min.js"></script>
        <script type="text/javascript">
            $(document).ready(function() {
                $('#dataTable').dataTable( {
                    "language": {
                        "url": "traducoes/traducao_table.txt"
                    }
                } );
            } );
        </script>

The translation archive is like this:

{
    "sEmptyTable": "Nenhum registro encontrado",
    "sInfo": "Mostrando de _START_ até _END_ de _TOTAL_ registros",
    "sInfoEmpty": "Mostrando 0 até 0 de 0 registros",
    "sInfoFiltered": "(Filtrados de _MAX_ registros)",
    "sInfoPostFix": "",
    "sInfoThousands": ".",
    "sLengthMenu": "_MENU_ resultados por página",
    "sLoadingRecords": "Carregando...",
    "sProcessing": "Processando...",
    "sZeroRecords": "Nenhum registro encontrado",
    "sSearch": "Pesquisar",
    "oPaginate": {
        "sNext": "Próximo",
        "sPrevious": "Anterior",
        "sFirst": "Primeiro",
        "sLast": "último"
    },
    "oAria": {
        "sSortAscending": ": Ordenar colunas de forma ascendente",
        "sSortDescending": ": Ordenar colunas de forma descendente"
    }
}
  • The charset is already set at the head of the page.

  • That could be a zillion different things. Without you posting more details about your project, including things from the server you’re using and HTTP headers of your requests and responses, it’s hard to help you.

  • The question does not give many details. Erick, please, give us more details so that we can help you. Let us know all the details of the page, the language (PHP, C#, Java etc.), the options you put in the plugin etc. Always be welcome, but read here on this page to know how things work more or less.

  • I am using php to compose my page that is allocated on a web server. I have edited the question to try to meet the request made by you. The code snippet of the <head> happens after defining a title and after setting the charset.

  • I would try a few things, for example: Set the charset in the datatable javascript call and open the js of the datatables in Notepad++ and in the format tab convert to the desired charset.

No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.