GithubHelp home page GithubHelp logo

seedstack / i18n-addon Goto Github PK

View Code? Open in Web Editor NEW
2.0 2.0 3.0 874 KB

Server-side internationalization providing a Java and REST API and management screens.

Home Page: http://seedstack.org/addons/i18n

License: Mozilla Public License 2.0

Java 76.07% JavaScript 9.94% CSS 3.90% HTML 9.37% Dockerfile 0.20% Shell 0.52%

i18n-addon's Introduction

SeedStack meta-repository

This meta-repository contains the full stack as Git submodules.

Usage

You can initialize all submodules to the tip of their master branch and checkout it with the following commands:

git submodule update --remote --recursive --init && git submodule foreach --recursive git checkout master

Later, you may need to update all submodules to the tip of their master branch again:

git submodule foreach --recursive git pull --ff-only origin master:master

Meta

This repository also contains all things meta about SeedStack like contributing rules, legal terms, assets, the list of contributors, etc...

Contributing to SeedStack

The CONTRIBUTING.md file in this repository defines the global contribution rules to SeedStack. Beyond this file, more specific rules may apply on some repositories. When a specific CONTRIBUTING.md file is available in a repository, please follow its rules in addition to the global rules.

Issue tracking

All SeedStack issues are aggregated on this Waffle board.

Copyright and license

SeedStack source code and documentation is copyrighted by "The SeedStack Authors", whose list is available in the AUTHORS file.

Source code is released under the terms of the Mozilla Public License 2.0.

Documentation is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License.

Additional legal terms are available under the legal subdirectory.

Logo

SeedStack logo is available in various sizes and formats in the assets/logo subdirectory of this repository. The logo is copyrighted by "The SeedStack Authors". Please ask us the permission before any use of the logo.

i18n-addon's People

Contributors

adrienlauer avatar nheverest avatar pith avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

i18n-addon's Issues

The statistic chart doesn't work after w20 M3

Seems like the update to w20 dataviz broke some things. The reported error:

nv.models.multiBarChart(...).margin(...).x(...).y(...).forceY(...).width(...).height(...).showXAxis(...).showYAxis(...).showLegend(...).showControls(...).tooltips(...).reduceXTicks(...).staggerLabels(...).noData(...).rotateLabels(...).color(...).delay is not a function 

Provide an autonomous i18n microservice

The i18n add-on already provides a Java API and and a REST API. The idea here is to go beyond that and provide an autonomous version of i18n, executing as a containerized micro-service.

This i18n service will have the following characteristics:

  • Be containerized
  • Be secured with the OAuth protocol
  • Have a easily configurable DB and OAuth provider through environment variables
  • Made available on the Docker hub as a Docker image.

Wrong matching from locales to W20 cultures

When providing the configured locales to W20, the I18nConfigurationHandler matching algorithm is producing incorrect outputs.

This seems to be due to a mix-and-match between underscore-separated locales and dash-separated IETF language tags.

NullPointerException when importing keys of internationalization

I've tried to import a csv with all my keys of internationalization, exported from another environment, and I've got a NullPointerException. SEED version: 15.1.1.

This is the full stacktrace:

-- [ERROR] [T] (EZZZZZ) --- 2015/07/27 15:46:13:699 - GeneralExceptionMapperToResponse http-8380-3 --
org.examples.app.exceptions.GeneralExceptionMapper [http-8380-3]
#XXXGENXTOR001 
Technical problem. Contact the Helpdesk. 
--------------------------------------------------------------------------------
java.lang.NullPointerException
    at org.seedstack.i18n.rest.io.IOResource.uploadTranslations(IOResource.java:84)
    at org.seedstack.seed.transaction.internal.LocalTransactionManager.doMethodInterception(LocalTransactionManager.java:57)
    at org.seedstack.seed.transaction.internal.AbstractTransactionManager$MethodInterceptorImplementation.invoke(AbstractTransactionManager.java:72)
    at org.seedstack.seed.security.internal.authorization.RequiresPermissionsInterceptor.invoke(RequiresPermissionsInterceptor.java:51)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:597)
    at com.sun.jersey.spi.container.JavaMethodInvokerFactory$1.invoke(JavaMethodInvokerFactory.java:60)
    at com.sun.jersey.server.impl.model.method.dispatch.AbstractResourceMethodDispatchProvider$ResponseOutInvoker._dispatch(AbstractResourceMethodDispatchProvider.java:205)
    at com.sun.jersey.server.impl.model.method.dispatch.ResourceJavaMethodDispatcher.dispatch(ResourceJavaMethodDispatcher.java:75)
    at com.sun.jersey.server.impl.uri.rules.HttpMethodRule.accept(HttpMethodRule.java:302)
    at com.sun.jersey.server.impl.uri.rules.ResourceClassRule.accept(ResourceClassRule.java:108)
    at com.sun.jersey.server.impl.uri.rules.RightHandPathRule.accept(RightHandPathRule.java:147)
    at com.sun.jersey.server.impl.uri.rules.RootResourceClassesRule.accept(RootResourceClassesRule.java:84)
    at com.sun.jersey.server.impl.application.WebApplicationImpl._handleRequest(WebApplicationImpl.java:1542)
    at com.sun.jersey.server.impl.application.WebApplicationImpl._handleRequest(WebApplicationImpl.java:1473)
    at com.sun.jersey.server.impl.application.WebApplicationImpl.handleRequest(WebApplicationImpl.java:1419)
    at com.sun.jersey.server.impl.application.WebApplicationImpl.handleRequest(WebApplicationImpl.java:1409)
    at com.sun.jersey.spi.container.servlet.WebComponent.service(WebComponent.java:409)
    at com.sun.jersey.spi.container.servlet.ServletContainer.service(ServletContainer.java:558)
    at com.sun.jersey.spi.container.servlet.ServletContainer.doFilter(ServletContainer.java:927)
    at com.sun.jersey.spi.container.servlet.ServletContainer.doFilter(ServletContainer.java:875)
    at com.sun.jersey.spi.container.servlet.ServletContainer.doFilter(ServletContainer.java:829)
    at com.google.inject.servlet.FilterChainInvocation.doFilter(FilterChainInvocation.java:82)
    at org.apache.shiro.guice.web.SimpleFilterChain.doFilter(SimpleFilterChain.java:44)
    at org.apache.shiro.web.servlet.AdviceFilter.executeChain(AdviceFilter.java:108)
    at org.apache.shiro.web.servlet.AdviceFilter.doFilterInternal(AdviceFilter.java:137)
    at org.apache.shiro.web.servlet.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:125)
    at org.apache.shiro.guice.web.SimpleFilterChain.doFilter(SimpleFilterChain.java:41)
    at org.apache.shiro.web.servlet.AbstractShiroFilter.executeChain(AbstractShiroFilter.java:449)
    at org.apache.shiro.web.servlet.AbstractShiroFilter$1.call(AbstractShiroFilter.java:365)
    at org.apache.shiro.subject.support.SubjectCallable.doCall(SubjectCallable.java:90)
    at org.apache.shiro.subject.support.SubjectCallable.call(SubjectCallable.java:83)
    at org.apache.shiro.subject.support.DelegatingSubject.execute(DelegatingSubject.java:383)
    at org.apache.shiro.web.servlet.AbstractShiroFilter.doFilterInternal(AbstractShiroFilter.java:362)
    at org.apache.shiro.web.servlet.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:125)
    at com.google.inject.servlet.FilterChainInvocation.doFilter(FilterChainInvocation.java:82)
    at com.thetransactioncompany.cors.CORSFilter.doFilter(CORSFilter.java:169)
    at com.thetransactioncompany.cors.CORSFilter.doFilter(CORSFilter.java:232)
    at com.google.inject.servlet.FilterChainInvocation.doFilter(FilterChainInvocation.java:82)
    at com.google.inject.servlet.ManagedFilterPipeline.dispatch(ManagedFilterPipeline.java:120)
    at com.google.inject.servlet.GuiceFilter$1.call(GuiceFilter.java:132)
    at com.google.inject.servlet.GuiceFilter$1.call(GuiceFilter.java:129)
    at com.google.inject.servlet.GuiceFilter$Context.call(GuiceFilter.java:206)
    at com.google.inject.servlet.GuiceFilter.doFilter(GuiceFilter.java:129)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
    at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
    at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
    at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
    at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
    at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
    at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:286)
    at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:845)
    at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
    at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
    at java.lang.Thread.run(Thread.java:662)
--------------------------------------------------------------------------------

Content of csv file used for the test:

key;en-GB;es-ES;es-AR;pt-PT;pt-BR;sk-SK;ru-RU;zh-CN;fr-CN;en-CN;fr-FR
sqr.button.add;;;;;;;;;;;Ajouter
sqr.button.cancel;;;;;;;;;;;Annuler
sqr.button.consult;;;;;;;;;;;Consulter
sqr.button.continuer;;;;;;;;;;;Continuer
application.view.seed-i18n.saveandnew;Save and new;;;;;;;;;;Enregistrer et nouveau
application.view.seed-i18n.i18n;Internationalization;;;;;;;;;;Internationalisation
application.view.seed-i18n.deletefiltered;Delete all currently filtered keys;;;;;;;;;;Supprimer les clés filtrées
application.view.seed-i18n.minimumlocales;You must set at least two application locales and a default locale to enable this menu;;;;;;;;;;Vous devez configurer au minimum deux langues et une langue par défaut
application.view.seed-i18n.outdated;Outdated;;;;;;;;;;Obsolète
application.view.seed-i18n.messagenolanguage;Be sure to set a default locale and application locales to translate;;;;;;;;;;Définissez une locale par défaut ainsi que des locales d'applicatons
application.view.app-admin.replication;;;;;;;;;;;Replication

Add support for custom locales

In specific cases, custom locales may be needed to fully represent the user culture (or to do some hacky things with locale hierarchy).

Our i18n function already supports arbitrary locale codes so adding the ability to specify custom locales in configuration shouldn't pose any problem.

Note that these custom cultures won't really work unless the real culture data is provided for them (in the backend with Java/ICU and/or in the frontend with W20/Globalize).

What if we want to use another persistence than JPA ?

What should we do if we wanted to use another persistence ?

  1. Nothing. We won't support that
  2. Put the JPA infrastructure in a separate JAR
  3. Add other persistences in the Core JAR and provide a way to choose via configuration

I think the second would be the good one, the only annoying thing would be that you will have to specify two jar instead of one (web + persistence).

Isolate the ICU library in another module

The i18n function is quite heavy due to the ICU library. It would be interesting to isolate it in another module. This will avoid to weigh down projects that only need few locales.

Update i18n-addon DDL scripts

i18n-addon DDL scripts have been updated for hsql to match latest domain structure, but not for mysql and oracle.
Oracle and mysql scripts must be updated as well.

Encoding problem in translation export

Exporting translations to CSV seems to produce encoding errors with accentuated characters. This issue is not yet confirmed but writing an integration test for it might be a good idea, regardless of its validity. Then we should fix it if necessary.

Improve CSV import

Currently, CSV import doesn't support importing a file which contains keys already present in persistence. The import resource could merge the CSV file with existing data or at least provide a boolean option to clear the existing data before importing (or both).

Extract dropzone lib

Dropzone component should be moved to fragment extra (currently it is hard managed inside the webapp)

W20 available locales are truncated

When the W20 configuration handler computes the locales, it simplifies them systematically to the generic locales, i.e. it converts en-US to en even if en-US is valid.

It was originally reported by @mariaantonia.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.