Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add angular-l10n to comparison table #81

Closed
IlCallo opened this issue Sep 17, 2019 · 10 comments
Closed

Add angular-l10n to comparison table #81

IlCallo opened this issue Sep 17, 2019 · 10 comments

Comments

@IlCallo
Copy link

IlCallo commented Sep 17, 2019

I'm submitting a...


[ ] Regression (a behavior that used to work and stopped working in a new release)
[ ] Bug report  
[ ] Performance issue
[ ] Feature request
[x] Documentation issue or request
[ ] Support request
[ ] Other... Please describe:

Current behavior

There is a beautiful comparison table, but angular-l10n is missing.
angular-l10n was probably the best i18n library for Angular before Transloco, so a comparison with it would be really interesting.
I see someone already asked for it into #13

Expected behavior

Add angular-l10n to the table.

What is the motivation / use case for changing the behavior?

Clarity, documentation, help devs to choose what fits them best.

@NetanelBasal
Copy link
Contributor

I updated the table. Let me know if there are any mistakes, and I will update. Thanks.

@IlCallo
Copy link
Author

IlCallo commented Sep 17, 2019

Perfect, thank you!
There are some things wrong:

  • listenToLangChange: angular-l10n provide LocaleService to listen and react to locale changes
  • Multiple Languages Simultaneously: pretty much every goodies of angular-l10n accept an optional lang to use instead of the default one. I'm just not sure about directives 🤔
  • Hackable: while not hackable as transloco, angular-l10n allow to hack some pieces of its configuration as needed (missing value management, storage strategy, custom translation provider, etc)
  • Ivy support: actually it supports Ivy, it doesn't support it only when using in combination with AOT (does Transloco work with AOT? It's not specified anywhere), but that's an Angular core problem
  • Additional Functionality: angular-l10n have a ton of additional features, for example SEO optimization, translations lazy loading, locale detection via Accept-Language header, value validation locale-based, etc etc. You can probably put some of those into transloco

I think there's more, but this is what I know from personal usage and docs reading

@NetanelBasal
Copy link
Contributor

NetanelBasal commented Sep 17, 2019

Hi, couple of notes:

  • listenToLangChange - Read in the docs what it means, please.
  • Multiple Languages Simultaneously - and you can use it in the template?
  • Hackable - not the same, but I will think of something
  • Ivy support - "it doesn't support it only when using in combination with AOT", so it doesn't support Ivy. Everyone uses AOT. Yes, we support Ivy with AOT. They don't because of the Lang decorator is incompatible.
  • Additional Functionality - I will remove it from the table as it's too general.

@NetanelBasal
Copy link
Contributor

@IlCallo you're welcome to submit a PR for any additional functionality you want.

@IlCallo
Copy link
Author

IlCallo commented Sep 17, 2019

  • listenToLangChange - Ok, I got it now, you meant the optimization due to unsubscribing.
  • Multiple Languages Simultaneously - Yes, all pipes have a lang parameter. Cannot remember if it works with the directive too or not, on docs is not specified.
  • Hackable - the "partially" you added is fine I think :)
  • Ivy support - well, it doesn't support it when using decorators, so it actually supports Ivy except that use case. You don't support getting current language via decorator, so saying that Ivy isn't supported on that project because it isn't supported when using a feature you don't have doesn't seem really fair to me. Also, in a year and half of usage of that package I never had to use decorators: pipes, directives and services are just much more used. So maybe it can be a check mark with a side note?

@NetanelBasal
Copy link
Contributor

NetanelBasal commented Sep 17, 2019

  • You should reread it. Anyway, this bullet is confusing. I removed it.
  • Tell me what I'm missing because it doesn't seem to work:
<h3>{{ 'changeCountry' | translate: 'en' }}</h3>
<h3>{{ 'changeCountry' | translate: 'it' }}</h3>
  • Added partially support.
  • It's all over the docs, so I guessed this is the main use-case. I will update the table.

You don't support getting current language via a decorator

We don't need to support it. It's work out of the box in Transloco without this boilerplate code.

@IlCallo
Copy link
Author

IlCallo commented Sep 17, 2019

  • listenToLangChange - Ok, I got it now, you meant the optimization due to unsubscribing. I understood it while you were writing and edited previous comment at the same time you add the new comment.
  • Multiple Languages Simultaneously - I was pretty sure I used it somewhere (I don't have access to that codebase anymore) but I guess I was wrong, sorry 😓
  • Ivy support - I think you updated the wrong bullet in the README (Pipe works with AOT, it's Pipe + AOT + Ivy which doesn't)

We don't need to support it. It's work out of the box in Transloco without this boilerplate code.

Not wanna pick a fight here, and you are right about the "works out of the box" thing, but the boilerplate in angular-l10n is needed to keep the pipe pure, while you decided to go by the inpure pipe road.

Not saying it's wrong but it degrades performance, so you probably should add a disclaimer on the documentation.
angular-l10n used impure pipes too, then decided to move to pure pipes and add the boilerplate, to avoid performance issues.

But maybe you found a way to avoid impure pipe performance degradation or you already studied the problem and noticed the performance impact isn't so high even with a lot of pipes used around, in that case sorry to bother :)

@NetanelBasal
Copy link
Contributor

Our solution is a structural directive.

@NetanelBasal
Copy link
Contributor

I will stop this discussion here. It becomes to be a discussion of who's better, and I don't like it. It's your decision whether to use angular-l10n or any other solution. We appreciate every library and think that's good.

If there are more mistakes in the table, I will update. Thanks.

@IlCallo
Copy link
Author

IlCallo commented Sep 18, 2019

I think I couldn't explain myself good enough: mine where just suggestions plus some context, not attacks to the library or saying which one is best (in my opinion, transloco is the best right now).

Anyway, the table is now correct, original issue is solved: keep on the great work! :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants