Ir para conteúdo


Foto

Deixar sistema em português


Melhor Resposta Wemerson Januario , 28 September 2015 - 14:55

olá, no seu arquivo app.json

defina o idioma

"locale": "pt_BR",

e faça o require do package locale na sua toolkit

"classic": {
"requires": [
"locale"
],

e rode o comando sencha app refresh para atualziar

Visualizar todo o conteúdo do post


  • Por favor, faça o login para responder
12 respostas neste tópico

#1 Patrick_Canciani

Patrick_Canciani

    Member Avançado

  • Membros
  • PipPipPip
  • 109 posts

Postado 28 September 2015 - 14:28

Olá galera,

 

Estava programando na versão 4.2 porem agora resolvi começar a criar o sistema em 6.0.1 porem estou tendo o problema que todo o sistema esta em inglês e os textos com acentos não estão aparecendo.

 

Antes era so adicionar o arquivo de tradução, (<script type="text/javascript"src="../extjs/locale/ext-lang-pt_BR.js" charset="UTF-8"></script>) porem nao consegui este arquivo para a versão 6.x e também nao consegui achar como fazer esta tradução alguem tem alguma ideia de como fazer isso?

 

Agradeço a ajuda de todos.



#2 Wemerson Januario

Wemerson Januario

    Administrador Ext JS Brasil

  • Administrators
  • 857 posts
  • LocationGoiânia - GO

Postado 28 September 2015 - 14:55   Melhor Resposta

olá, no seu arquivo app.json

defina o idioma

"locale": "pt_BR",

e faça o require do package locale na sua toolkit

"classic": {
"requires": [
"locale"
],

e rode o comando sencha app refresh para atualziar


  • DaniloTerra curtiu isso

Wemerson Januario
http://wemersonjanuario.com.br
Twitter: @januariocoder

 

Treinamento e Consultoria Ext JS. Qualifique-se já!


#3 Patrick_Canciani

Patrick_Canciani

    Member Avançado

  • Membros
  • PipPipPip
  • 109 posts

Postado 28 September 2015 - 15:53

Obrigado pela ajuda,

 

inseri a linha ("locale": "pt_BR",) e ajustei  a parte do build  do classic com os requires porem ainda continua com nao aparecendo os caracteres somente os �.



#4 Wemerson Januario

Wemerson Januario

    Administrador Ext JS Brasil

  • Administrators
  • 857 posts
  • LocationGoiânia - GO

Postado 28 September 2015 - 15:55

como está o seu index.html? é o original criado pelo sencha cmd?

está como a meta ? 

 <meta charset="UTF-8">

Wemerson Januario
http://wemersonjanuario.com.br
Twitter: @januariocoder

 

Treinamento e Consultoria Ext JS. Qualifique-se já!


#5 Patrick_Canciani

Patrick_Canciani

    Member Avançado

  • Membros
  • PipPipPip
  • 109 posts

Postado 28 September 2015 - 16:01

Sim e o original:

<!DOCTYPE HTML>
<html manifest="">
<head>
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta http-equiv="Content-Type" content="text/html;charset=UTF-8" >
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">

    <title>MeuApp</title>

    
    <script type="text/javascript">
        var Ext = Ext || {}; // Ext namespace won't be defined yet...

        // This function is called by the Microloader after it has performed basic
        // device detection. The results are provided in the "tags" object. You can
        // use these tags here or even add custom tags. These can be used by platform
        // filters in your manifest or by platformConfig expressions in your app.
        //
        Ext.beforeLoad = function (tags) {
            var s = location.search,  // the query string (ex "?foo=1&bar")
                profile;

            // For testing look for "?classic" or "?modern" in the URL to override
            // device detection default.
            //
            if (s.match(/\bclassic\b/)) {
                profile = 'classic';
            }
            else if (s.match(/\bmodern\b/)) {
                profile = 'modern';
            }
            else {
                profile = tags.desktop ? 'classic' : 'modern';
                //profile = tags.phone ? 'modern' : 'classic';
            }
			
            Ext.manifest = profile; // this name must match a build profile name

            // This function is called once the manifest is available but before
            // any data is pulled from it.
            //
            //return function (manifest) {
                // peek at / modify the manifest object
            //}; 
        };
    </script>
    
    
    <!-- The line below must be kept intact for Sencha Cmd to build your application -->
    <script id="microloader" data-app="c2889899-272b-4e87-9a9e-2b3c24f6f8a2" type="text/javascript" src="bootstrap.js"></script>

</head>
<body></body>
</html>

e aqui o meu app.json:

{
    /**
     * The application's namespace.
     */
    "name": "MeuApp",
    
    /**
     * The version of the application.
     */
    "version": "1.0.0.0",

    /**
     * The relative path to the application's markup file (html, jsp, asp, etc.).
     */
    "indexHtmlPath": "index.html",

    /**
     * Comma-separated string with the paths of directories or files to search. Any classes
     * declared in these locations will be available in your class "requires" or in calls
     * to "Ext.require". The "app.dir" variable below is expanded to the path where the
     * application resides (the same folder in which this file is located).
     */
    "classpath": [
        "app",
        "${toolkit.name}/src"
    ],

    /**
     * Comma-separated string with the paths of directories or files to search. Any classes
     * declared in these locations will be automatically required and included in the build.
     * If any file defines an Ext JS override (using Ext.define with an "override" property),
     * that override will in fact only be included in the build if the target class specified
     * in the "override" property is also included.
     */
    "overrides": [
        "overrides",
        "${toolkit.name}/overrides"
    ],
	
	"locale": "pt_BR",

    /**
     * The Sencha Framework for this application: "ext" or "touch".
     */
    "framework": "ext",
    
    /**
     * The toolkit to use. Select either "classic" or "modern".
     */
    
    
    /**
     * The name of the theme for this application.
     */
    
    /**
     * The list of required packages (with optional versions; default is "latest").
     *
     * For example,
     *
     *      "requires": [
     *          "charts"
     *      ]
     */
    "requires": [
        "font-awesome"
    ],

    /**
     * Fashion build configuration properties.
     */
    "fashion": {
        "inliner": {
            /**
             * Disable resource inliner. Production builds enable this by default.
             */
            "enable": false
        }
    },

    /**
     * Sass configuration properties.
     */
    "sass": {
        /**
         * The root namespace to use when mapping *.scss files to classes in the
         * sass/src and sass/var directories. For example, "MeuApp.view.Foo" would
         * map to "sass/src/view/Foo.scss". If we changed this to "MeuApp.view" then
         * it would map to "sass/src/Foo.scss". To style classes outside the app's
         * root namespace, change this to "". Doing so would change the mapping of
         * "MeuApp.view.Foo" to "sass/src/MeuApp/view/Foo.scss".
         */
        "namespace": "MeuApp",

        /**
         * File used to save sass variables edited via Sencha Inspector. This file
         * will automatically be applied to the end of the scss build.
         *
         *      "save": "sass/save.scss"
         *
         */
         
        /**
         * Comma-separated list of files or folders containing extra Sass. These
         * files are automatically included in the Sass compilation. By default this
         * is just "etc/all.scss" to allow import directives to control the order
         * other files are included.
         *
         * All "etc" files are included at the top of the Sass compilation in their
         * dependency order:
         *
         *      +-------+---------+
         *      |       | base    |
         *      | theme +---------+
         *      |       | derived |
         *      +-------+---------+
         *      | packages        |  (in package dependency order)
         *      +-----------------+
         *      | application     |
         *      +-----------------+
         */
        "etc": [
            "sass/etc/all.scss",
            "${toolkit.name}/sass/etc/all.scss"
        ],

        /**
         * Comma-separated list of folders containing Sass variable definitions
         * files. These file can also define Sass mixins for use by components.
         *
         * All "var" files are included after "etc" files in the Sass compilation in
         * dependency order:
         *
         *      +-------+---------+
         *      |       | base    |
         *      | theme +---------+
         *      |       | derived |
         *      +-------+---------+
         *      | packages        |  (in package dependency order)
         *      +-----------------+
         *      | application     |
         *      +-----------------+
         *
         * The "sass/var/all.scss" file is always included at the start of the var
         * block before any files associated with JavaScript classes.
         */
        "var": [
            "sass/var/all.scss",
            "sass/var",
            "${toolkit.name}/sass/var"
        ],

        /**
         * Comma-separated list of folders containing Sass rule files.
         *
         * All "src" files are included after "var" files in the Sass compilation in
         * dependency order (the same order as "etc"):
         *
         *      +-------+---------+
         *      |       | base    |
         *      | theme +---------+
         *      |       | derived |
         *      +-------+---------+
         *      | packages        |  (in package dependency order)
         *      +-----------------+
         *      | application     |
         *      +-----------------+
         */
        "src": [
            "sass/src",
            "${toolkit.name}/sass/src"
        ]
    },

    /**
     * List of all JavaScript assets in the right execution order.
     *
     * Each item is an object with the following format:
     *
     *      {
     *          // Path to file. If the file is local this must be a relative path from
     *          // this app.json file.
     *          //
     *          "path": "path/to/script.js",   // REQUIRED
     *
     *          // Set to true on one file to indicate that it should become the container
     *          // for the concatenated classes.
     *          //
     *          "bundle": false,    // OPTIONAL
     *
     *          // Set to true to include this file in the concatenated classes.
     *          //
     *          "includeInBundle": false,  // OPTIONAL
     *
     *          // Specify as true if this file is remote and should not be copied into the
     *          // build folder. Defaults to false for a local file which will be copied.
     *          //
     *          "remote": false,    // OPTIONAL
     *
     *          // If not specified, this file will only be loaded once, and cached inside
     *          // localStorage until this value is changed. You can specify:
     *          //
     *          //   - "delta" to enable over-the-air delta update for this file
     *          //   - "full" means full update will be made when this file changes
     *          //
     *          "update": "",        // OPTIONAL
     *
     *          // A value of true indicates that is a development mode only dependency.
     *          // These files will not be copied into the build directory or referenced
     *          // in the generate app.json manifest for the micro loader.
     *          //
     *          "bootstrap": false   // OPTIONAL
     *      }
     *
     */
    "js": [
        {
            "path": "app.js",
            "bundle": true
        }
    ],

    /**
     * Settings specific to classic toolkit builds.
     */
    "classic": {
        "js": [
            // Remove this entry to individually load sources from the framework.
            {
                "path": "${framework.dir}/build/ext-all-rtl-debug.js"
            }
        ]
    },

    /**
     * Settings specific to modern toolkit builds.
     */
    "modern": {
        "js": [
            // Remove this entry to individually load sources from the framework.
            {
                "path": "${framework.dir}/build/ext-modern-all-debug.js"
            }
        ]
    },

    /**
     * List of all CSS assets in the right inclusion order.
     *
     * Each item is an object with the following format:
     *
     *      {
     *          // Path to file. If the file is local this must be a relative path from
     *          // this app.json file.
     *          //
     *          "path": "path/to/stylesheet.css",   // REQUIRED
     *
     *          // Specify as true if this file is remote and should not be copied into the
     *          // build folder. Defaults to false for a local file which will be copied.
     *          //
     *          "remote": false,    // OPTIONAL
     *
     *          // If not specified, this file will only be loaded once, and cached inside
     *          // localStorage until this value is changed. You can specify:
     *          //
     *          //   - "delta" to enable over-the-air delta update for this file
     *          //   - "full" means full update will be made when this file changes
     *          //
     *          "update": ""      // OPTIONAL
     *      }
     */
    "css": [
        {
            // this entry uses an ant variable that is the calculated
            // value of the generated output css file for the app,
            // defined in .sencha/app/defaults.properties
            "path": "${build.out.css.path}",
            "bundle": true,
            "exclude": ["fashion"]
        }
    ],

    /**
     * This option is used to configure the dynamic loader. At present these options
     * are supported.
     *
     */
     "loader": {
         // This property controls how the loader manages caching for requests:
         //
         //   - true: allows requests to receive cached responses
         //   - false: disable cached responses by adding a random "cache buster"
         //   - other: a string (such as the build.timestamp shown here) to allow
         //     requests to be cached for this build.
         //
         "cache": false,

         // When "cache" is not true, this value is the request parameter used
         // to control caching.
         //
         "cacheParam": "_dc"
     },

    /**
     * Settings specific to production builds.
     */
    "production": {
        "output": {
            "appCache": {
                "enable": true,
                "path": "cache.appcache"
            }
        },
        "loader": {
            "cache": "${build.timestamp}"
        },
        "cache": {
            "enable": true
        },
        "compressor": {
            "type": "yui"
        }
    },
    
    /**
     * Settings specific to testing builds.
     */
    "testing": {
    },
    
    /**
     * Settings specific to development builds.
     */
    "development": {
        "tags": [
            // You can add this tag to enable Fashion when using app watch or
            // you can add "?platformTags=fashion:1" to the URL to enable Fashion
            // without changing this file.
            //
            // "fashion"
        ]
    },

    /**
     * Controls the output structure of development-mode (bootstrap) artifacts. May
     * be specified by a string:
     *
     *      "bootstrap": "${app.dir}"
     *
     * This will adjust the base path for all bootstrap objects, or expanded into object
     * form:
     *
     *      "bootstrap": {
     *          "base": "${app.dir},
     *          "manifest": "bootstrap.json",
     *          "microloader": "bootstrap.js",
     *          "css": "bootstrap.css"
     *      }
     *
     * You can optionally exclude entries from the manifest. For example, to exclude
     * the "loadOrder" (to help development load approximate a build) you can add:
     *
     *      "bootstrap": {
     *          "manifest": {
     *              "path": "bootstrap.json",
     *              "exclude": "loadOrder"
     *          }
     *      }
     *
     */
    "bootstrap": {
        "base": "${app.dir}",
        
        "manifest": "${build.id}.json",
        
        "microloader": "bootstrap.js",
        "css": "bootstrap.css"
    },

    /**
     * Controls the output directory for build resources.  May be set with
     * either a string:
     *
     *      "${workspace.build.dir}/${build.environment}/${app.name}"
     *
     * or an object containing values for various types of build artifacts:
     *
     *      {
     *          "base": "${workspace.build.dir}/${build.environment}/${app.name}",
     *          "page": {
     *              "path": "../index.html",
     *              "enable": false
     *          },
     *          "css": "${app.output.resources}/${app.name}-all.css",
     *          "js": "app.js",
     *          "microloader": {
     *              "path": "microloader.js",
     *              "embed": true,
     *              "enable": true
     *          },
     *          "manifest": {
     *              "path": "app.json",
     *              "embed": false,
     *              "enable": "${app.output.microloader.enable}"
     *          },
     *          "resources": "resources",
     *          "slicer": {
     *              "path": "${app.output.resources}/images",
     *              "enable": false
     *          },
     *          // Setting the "enable" property of this object to a Truthy value will cause a Application Cache
     *          // manifest file to be generated based on this files appCache object. This file will then be injected
     *          // into the index.html file of the built application
     *          "appCache":{
     *              "enable": false"
     *          }
     *      }
     *
     */
    
    "output": {
        "base": "${workspace.build.dir}/${build.environment}/${app.name}",
        "page": "index.html",
        "manifest": "${build.id}.json",
        "js": "${build.id}/app.js",
        "appCache": {
            "enable": false
        },
        "resources": {
            "path": "${build.id}/resources",
            "shared": "resources"
        }
    },
    
    
    /**
    * Controls for localStorage caching
    *   "cache": {
    *       // This property controls whether localStorage caching of this manifest file is on or off.
    *       // if disabled no deltas will be generated during a build and full updates will be disabled
    *       "enable": false,
    *
    *       // This property allows for global toggle of deltas.
    *       // If set to a string the value will be used as the path to where deltas will be generated relative to you build.
    *       // If set to a Truthy Value the default path ok "deltas" will be used
    *       // If set to a Falsey value or if this property is not present deltas will be disabled and not generated.
    *
    *       "deltas": "deltas"
    *   }
    */
    
    "cache": {
        "enable": false,
        "deltas": "${build.id}/deltas"
    },
    

    /**
     * Used to automatically generate cache.manifest (HTML 5 application cache manifest)
     * file when you build.
     */
    "appCache": {
        /**
         * List of items in the CACHE MANIFEST section
         */
        "cache": [
            "index.html"
        ],
        /**
         * List of items in the NETWORK section
         */
        "network": [
            "*"
        ],
        /**
         * List of items in the FALLBACK section
         */
        "fallback": []
    },

    /**
     * Extra resources to be copied into the resource folder as specified in the "resources"
     * property of the "output" object. Folders specified in this list will be deeply copied.
     */
    "resources": [
        {
            "path": "resources",
            "output": "shared"
        },
        {
            "path": "${toolkit.name}/resources"
        },
        {
            "path": "${build.id}/resources"
        }
    ],

    /**
     * File / directory name patttern to ignore when copying to the builds. Must be a
     * valid regular expression.
     */
    "ignore": [
        "(^|/)CVS(/?$|/.*?$)"
    ],

    /**
     * Directory path to store all previous production builds. Note that the content
     * generated inside this directory must be kept intact for proper generation of
     * deltas between updates.
     */
    
    "archivePath": "archive/${build.id}",
    


    /**
     * The space config object is used by the "sencha app publish" command to publish
     * a version of this application to Sencha Web Application Manager:
     *
     *      "manager": {
     *          // the space id for this application
     *          "id": 12345,
     *
     *          // space host
     *          "host": "https://api.space.sencha.com/json.rpc",
     *
     *          // Either a zip file path or a folder to be zipped
     *          // this example shows how to publish the root folder for all build profiles
     *          "file": "${app.output.base}/../",
     *
     *          // These may be specified here, but are best specified in your user
     *          // ~/.sencha/cmd/sencha.cfg file
     *          "apiKey": "",
     *          "secret": ""
     *      }
     */

    /**
     * Build Profiles. This object's properties are each a "build profile". You can
     * add as many as you need to produce optimized builds for devices, themes, locales
     * or other criteria. Your "Ext.beforeLoad" hook (see index.html) is responsible for
     * selecting the desired build profile by setting "Ext.manifest" to one of these
     * names.
     *
     *     "builds": {
     *         "classic": {
     *             "toolkit": "classic",
     *             "theme": "theme-neptune"
     *         },
     *
     *         "modern": {
     *             "toolkit": "modern",
     *             "theme": "theme-neptune"
     *         }
     *     }
     *
     */
    
    "builds": {
        "classic": {
			"requires": [
				"locale"
			],
            "toolkit": "classic",
            
            "theme": "theme-triton",
            
            "sass": {
                // "save": "classic/sass/save.scss"
            }
        },

        "modern": {
            "toolkit": "modern",
            
            "theme": "theme-triton",
            
            "sass": {
                // "save": "modern/sass/save.scss"
            }
        }
    },
    

    /**
     * Uniquely generated id for this application, used as prefix for localStorage keys.
     * Normally you should never change this value.
     */
    "id": "c2889899-272b-4e87-9a9e-2b3c24f6f8a2"
}



#6 Wemerson Januario

Wemerson Januario

    Administrador Ext JS Brasil

  • Administrators
  • 857 posts
  • LocationGoiânia - GO

Postado 28 September 2015 - 16:11

será que não é sua IDE que tá fu#@$!**ER$%%  o encoding seu projeto?

muito estranho


Wemerson Januario
http://wemersonjanuario.com.br
Twitter: @januariocoder

 

Treinamento e Consultoria Ext JS. Qualifique-se já!


#7 Patrick_Canciani

Patrick_Canciani

    Member Avançado

  • Membros
  • PipPipPip
  • 109 posts

Postado 28 September 2015 - 16:23

vou tentar baixar de novo e tentar esse procedimento novamente depois posto aqui o resultado.



#8 Wemerson Januario

Wemerson Januario

    Administrador Ext JS Brasil

  • Administrators
  • 857 posts
  • LocationGoiânia - GO

Postado 28 September 2015 - 16:44

tenta gerar uma app pelo sencha cmd novamente do zero e veja se continua


Wemerson Januario
http://wemersonjanuario.com.br
Twitter: @januariocoder

 

Treinamento e Consultoria Ext JS. Qualifique-se já!


#9 Patrick_Canciani

Patrick_Canciani

    Member Avançado

  • Membros
  • PipPipPip
  • 109 posts

Postado 29 September 2015 - 08:53

Bom dia,

 

Gerei uma nova aplicação e modifiquei conforme dito a cima, todo o sistema ficou traduzido os botoes de yes e no viraram sim e não isso ficou perfeito mas o problema com os textos inseridos por min mesmo ainda não estão ficando com o encode correto por exemplo o meu "não" fica assim "n�o", alguma ideia de como corrigir isso?

 

Obrigado.



#10 DaniloTerra

DaniloTerra

    Novato

  • Membros
  • PipPip
  • 15 posts

Postado 29 September 2015 - 09:19

Tenta salvar o arquivo .JS com codificação UTF-8.


  • Wemerson Januario curtiu isso

#11 Patrick_Canciani

Patrick_Canciani

    Member Avançado

  • Membros
  • PipPipPip
  • 109 posts

Postado 29 September 2015 - 09:31

Perfeito Danilo! 

 

Não tinha me tocado deste detalhe da codificação do arquivo ficou show.

 

Obrigado a todos.


  • DaniloTerra curtiu isso

#12 julianoribero

julianoribero

    Iniciante

  • Membros
  • Pip
  • 3 posts
  • LocationGoiânia

Postado 11 August 2018 - 00:52

Olá pessoal, mesmo eu colocando 

"requires": [
"locale"
]

 

 

"locale""pt_BR"

 

no app.json ainda continua pegando o português de portugal. 

 

Alguém teve esse problema. 

 

Estou usando toolkit modern ext 6.5 ?


Juliano Ribeiro
Skype: julianoribero
Twitter: @julianoribero
Email: [email protected]
Goiânia-GO
Analise e desenvolvimento de sistemas usando ExtJs e Laravel.

#13 julianoribero

julianoribero

    Iniciante

  • Membros
  • Pip
  • 3 posts
  • LocationGoiânia

Postado 11 August 2018 - 01:04

Olá pessoal, mesmo eu colocando 

"requires": [
"locale"
]

 

 

"locale""pt_BR"

 

no app.json ainda continua pegando o português de portugal. 

 

Alguém teve esse problema. 

 

Estou usando toolkit modern ext 6.5 ?

 

 

Substituí o require por "ext-locale" e funcionou 

 


Juliano Ribeiro
Skype: julianoribero
Twitter: @julianoribero
Email: [email protected]
Goiânia-GO
Analise e desenvolvimento de sistemas usando ExtJs e Laravel.




0 usuário(s) está(ão) lendo este tópico

0 membros, 0 visitantes, 0 membros anônimos