Giter Site home page Giter Site logo

Comments (6)

FERNman avatar FERNman commented on August 23, 2024

Hi @leonarddevries ,

Great to hear you like the project! In general, you can set the language part just by setting the Local_ID in Angular. It uses this one for the Charts locale. That's a missing part in the Readme at least.
I am, however, not entirely sure if that's a good solution because it could be that the GoogleCharts package uses different language tags than GoogleCharts.

If you could try it out and verify if it's working (or not), that would be great!

from angular-google-charts.

leonarddevries avatar leonarddevries commented on August 23, 2024

Hi @FERNman, Thanks for your response. And yes I can confirm setting the LOCALE_ID works! 😄 For anyone else trying to set the locale, these are the necessary changes to your app.module.ts file:

import {LOCALE_ID, NgModule} from '@angular/core';
import localeNl from '@angular/common/locales/nl';
import {registerLocaleData} from '@angular/common';
registerLocaleData(localeNl, 'nl-NL');

@NgModule({
  ...
  providers: [{provide: LOCALE_ID, useValue: 'nl-NL'}],
  ...
})

Very nice this library uses the builtin way of setting the locale 👍

from angular-google-charts.

guibleme avatar guibleme commented on August 23, 2024

Hello, @FERNman, I'm trying to use the 'pt' locale and no matter what I do, it doesn't seem to work. The rest of my system fully understand the locale_id, besides this component. Is there any particular thing I should do?

from angular-google-charts.

FERNman avatar FERNman commented on August 23, 2024

Hey @guibleme,

Probably the underlying GoogleCharts library doesn't know this locale. However, I'm currently not able to check this. If this is the problem, I really don't know if there's anything we can do about it.

from angular-google-charts.

petrusgomes avatar petrusgomes commented on August 23, 2024

Hi @guibleme ,
I was able to use the 'pt' locale only with GoogleChartsModule.forRoot().
Just importing the module didn't work for me.

import {LOCALE_ID, NgModule} from '@angular/core';
import { registerLocaleData } from '@angular/common';
import localePt from '@angular/common/locales/pt';
registerLocaleData(localePt, 'pt');

@NgModule({
    imports: [
        GoogleChartsModule.forRoot()
    ],
    providers: [
        {provide: LOCALE_ID, useValue: 'pt'}
    ]
})

from angular-google-charts.

RootsMJ avatar RootsMJ commented on August 23, 2024

Hello,
I'm having an issue with setting the locale to Swedish ('sv').
This is my code:

import {LOCALE_ID, NgModule} from '@angular/core';
import { registerLocaleData } from '@angular/common';
import localeSv from '@angular/common/locales/sv';
registerLocaleData(localeSv, 'sv');

@NgModule({
    imports: [
        GoogleChartsModule.forRoot()
    ],
    providers: [
        {provide: LOCALE_ID, useValue: 'sv'}
    ]
})

I get an error requesting the resource from gstatic.com:

https://www.gstatic.com/charts/46.2/i18n/jsapi_compiled_i18n_Gantt_module__sv.js net::ERR_ABORTED 404

Is this due to issues with the underlying Google charts or is there something I can do to solve this?

from angular-google-charts.

Related Issues (20)

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.