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

Discussion: future of the library #783

Open
ocombe opened this issue Jan 30, 2018 · 84 comments
Open

Discussion: future of the library #783

ocombe opened this issue Jan 30, 2018 · 84 comments

Comments

@ocombe
Copy link
Collaborator

@ocombe ocombe commented Jan 30, 2018

Hello everyone, I'd like to discuss about the future of this library and get your opinion on my plans.

(Long) history

You can skip that part if you don't care about how this library came to life

When I started this library 3 years ago, I wanted to learn Angular and I thought that working on an open source project would be the best way to do that. It had worked for me on AngularJS with my library ocLazyLoad that was a huge success (2600 stars) and whose core principles were finally integrated into the framework in v1.6.7.

At the time I was looking for a way to translate my Angular apps and found out that there was nothing in Angular to do that (i18n wasn't even existing in the framework). I asked my good friend Pascal Precht if he was interested in porting angular-translate from AngularJS to Angular but he wasn't and told me that I should do it.

My library quickly became popular for various reasons (no real alternative, I had a good reputation from my work on ocLazyLoad, my appearances in Angular Air and my talks at conferences). And I guess that the code was good enough and easy to start with.
It was also a time where the framework was still in beta, and there were no real guidelines for publishing libraries for Angular, it was so hard to do it that not a lot of people were trying and I didn't have any real competition on i18n for a long time.

Some time later, the library ecosystem started to settle and Angular was stable, they decided to drop the name Angular 2/4/... in favor of just "Angular". I decided to rename this library ngx-translate and to use npm scopes in order to deliver a modular experience. I rewrote the whole library and made it possible to replace some parts (loader, parser, compiler, ...).
It was still a side project for me, but I was using it at work because we had finally started using Angular in production and needed to translate the app in multiple locales.

The official i18n implementation was super complicated (and still is), it didn't support json, code translation, changing the locale without reloading the app, and you needed multiple app bundles (one per locale). My library was so popular that I wanted to work on it full time because I could see that it was a necessity for the Angular community. It solved a lot of use cases, and was simple enough to be usable in a few minutes.

I decided to quit my job and see if I could make a living out my open source work. I knew that it was possible because ag-grid had done it and they were very successful. It was in December 2016, I had 2 months left at work before I was free, and I went to the conference NG-BE where Igor Minar from the core team was present. I wanted to ask him some advices on how to turn this into a profitable OSS project, but before I could tell him about my plans, he told me: "Ah Olivier, I wanted to talk to you, you've got to stop working on your library [ngx-translate], Companies come to us and want to do i18n, but they only talk about your library, we want them to use our solution [Angular i18n] because it's more efficient".

I was a bit speechless, I was there about to tell him that I had quit my job and wanted to work full time on my lib, and he was asking me to stop working on it. So I did what anyone with a bit of common sense would have done, I told him that Angular i18n sucked, that it failed to deliver the promise of easy-to-use-yet-powerful that they wanted Angular to be.
I probably didn't use those words, but he agreed with me that it still needed some work, but they didn't have enough resources to work on it (Victor Savkin and Jeff Cross had just left the team to create Nrwl).
I jumped on the occasion and told him that I would love to work with them to improve Angular i18n.
He told me that he would consider it, and we left it at that.

A few weeks later, and recontacted me, and told me that they were ok to hire me as a contractor to work on i18n. It was like Christmas for me (actually it was around Christmas, so that might explain it) because working for Google is a once in a lifetime opportunity and a dream job. But working on open source, from home, for Angular, it was even better and I didn't even thought that it was possible for me to do that.

I joined the team in February 2017 (almost a year ago), and started working on i18n. There was a lot of work to do, but I was confident that I could make a difference. It was clear to me at the time that it would take a few months to make i18n easier to use for everyone, with the features that people wanted, and that I could deprecate my library after that.

It turns out that working on a framework like Angular is super complicated. The codebase is huge, not highly documented, with a lot of different packages. The development process is complicated (it doesn't even work on Windows yet), and whenever you make a change you have to be extra careful not to break anyone. We even write tests, like a lot of tests! It was a big shift for me, because I had always worked on projects that needed to ship fast, and tests were clearly not the priority, you fixed bugs instead. But working on a library like Angular is totally different. Millions of people depend on your code, when you make a mistake you can break applications that loose thousands or hundred of thousands of dollars because of you. The responsibility is overwhelming and that's why it is much more complicated to release new features. I also wasn't the one deciding the priorities for the framework. Any change that you want to make has to work with Google applications, and it's not like you can duplicate functionalities to make it work for everyone (who said forms and http?).

Anyway it was complicated to change the way i18n worked in Angular. I learned a lot and I feel like we're going in the right direction now. I understand the choices that they made for Angular i18n, it's the most efficient and stable way to translate applications. It works very well for huge companies like Google, but it just isn't what most developers need/want.

During this year, I haven't really worked on ngx-translate. The issues are pilling up, I've only merged a few PRs and some of them have been waiting there for a long time without any activity because of me. There are some long term issues that I haven't taken the time to fix (code splitting / lazy loading, testing, ICU expressions, bugs with ionic...).

But before we get to that, let's quickly compare my library with the native implementation.

Angular

In Angular, you translate your templates using an extraction tool that generates xmb or xliff files, which are well defined formats that have been battle-tested. Those files are translated using professional tools, by real translators. At the end you merge the translations at build time and get a translated bundle.

Advantages:

  • The translation process is well defined, it is easy to detect missing translations and you can integrate that in your plans before deploying your app (extract, send to translators, merge)
  • It scales well, you never look directly at the files since you use a software for that, you can translate in x languages, you just need to extract once and create the translation files for each locale (which your professional tool should do for you)
  • it's super efficient because the app is pre-translated when it bootstraps, there's no extra work to apply your translations and it works well with pre-rendering because of that
  • since you merge the translations at build time, it means that it can support directives, components and other html elements, you can move them around in the different languages, or even remove them if needed
  • you don't need to worry about lazy loading, your bundles are translated at build time, and that includes your lazy loaded modules

Issues:

  • it takes a lot of work to setup, you need to extract, send to translators, and then you can merge
  • you create one app bundle / locale, which means that you cannot change the locale at runtime, you need to reload a different bundle for that. And to do that you need to handle server side routing to deliver the correct locale bundle. Google doesn't feel like it's an issue because you're not supposed to change your locale frequently. And in fact most of your users will change it maybe only once, or not at all. But it still complicates the workflow a lot.
  • no code translations, only template are translated since that's all you can do at build time for now
  • harder to use in development because you need to stop your dev server, extract translations, merge them. And the setup is different between JIT and AOT...
  • you cannot translate libraries, and that's a real problem for components libraries (like material, ng bootstrap, ...)

ngx-translate

With ngx-translate you load the module and configure it, you then load the json files containing your translations. You need to manually define keys for your translations and to write them in your json files that you will probably translate yourself, or transform into other formats that you'll send to your translators. But it's ok because json is easy to manipulate and generate.

Advantages:

  • you can choose how you want to handle your translations (bundled, http-loaded, pre-cached using service workers or localstorage, etc...)
  • you can change the locale at any time
  • it works in your templates AND in your code
  • json (that's all I need to say)
  • the community can work on plugins, custom loaders, tooling, etc... everything is hackable and you should be able to make it work the way you prefer

Issues:

  • it uses bindings (via a pipe or a directive) which means that it works at runtime and you can experience some kind of FOC effect (flash of content) when the translations are loaded and applied. Also it takes some memory and some processor time when change detection is triggered
  • if you want to split translations, it doesn't work well, the setup is complicated and there are bugs in the library
  • json is not an official translation format, and most professional translation tool don't handle that, but you can use different loaders to support other formats (like po) so that's not a super huge issue
  • it's hard to test
  • if it breaks, then your app will have no text!
  • it doesn't support angular elements (components, directives, pipes) because there's no "compile" at runtime for AOT applications

Changes in Angular

Like I said, I've been working on Angular i18n for almost a year now. I've actually worked on a lot of other things as well, and the changes in i18n were clearly not the priority for the framework. A lot of internal changes were also necessary before we could do the changes that we wanted.

I've greatly improved the documentation (i18n guide), I've created demo projects with and without the cli to help people get started. I've worked on bugs, and made a few changes, but we've not released anything major for translations.

Finally for v6 the big changes are coming, translating will be done at runtime. Having access to the internals of the framework means that it will be way more efficient than what ngx-translate does. You shouldn't experience the FOC effect, and it won't take any resource during change detection. You'll be able to do code translations, at last! There will only be one bundle per application for all of the locales (or multiple, if you prefer). And libraries should be translatable.

What will not change:

  • you'll still have to extract translations using the extraction tool and merge them at build time, which means that's it's not very easy to use in development
  • there's no json format yet (we've been discussing internally about opening the API so that developers can write their own serializers if they want)
  • it'll still be more complicated to setup and to use than ngx-translate
  • you can translate at runtime in your code, but the templates will be translated at bootstrap, which means that you cannot change the locale without reloading the app
  • new features will still take a long time to be implemented, because we don't have the freedom that a library like ngx-translate has

So what about ngx-translate future?

This has been a long post, and we're finally getting to the part where we talk about the future of ngx-translate. The way I see it there are 2 solutions:

1/ we continue like it has been for the past year, only merging a few PRs, not working on new features and not improving the workflow. I keep working on making Angular i18n better and hopefully people will stop using this library because the native solution will be better. Or maybe a real alternative will emerge (like https://github.com/robisim74/angular-l10n).

2/ I change the way I work and decide to spend more time on the library (at least 1 day/week) to improve it: fixing lazy loading, code splitting, adding functions to help with testing, support ICU expressions, create well documented and maintained examples, finally tackle ionic and other mobile issues, ...
I focus on making sure that the library stays a viable alternative to Angular i18n by providing solutions to the "problems" that Angular i18n will not fix. I write better tooling, maybe even an editor for the translations. I rewrite the documentation, on a real website with shiny examples.

To do all of that, I would need to make this library profitable somehow. I was thinking about changing the license to require companies to pay for the library (while keeping it free for open source and personal projects) in exchange for priority support (for bugs fixing, and for working on the features that they want the most).
Obviously the current version would remain free and MIT-licensed, since there's no legal way to retroactively change a license, and it would be stupid to do that anyway. But new versions would be using this new license.

This library is downloaded ~350 000 times / month on npm now, if you compare that to the ~2 400 000 downloads of @angular/core, it means that my library is used in 1 out of 7 Angular projects! That's crazy, and it gives me confidence that this is viable.

What do you guys think? Would your companies be willing to pay for a better ngx-translate? Do you see any other alternative?

@bnymncoskuner

This comment has been minimized.

Copy link

@bnymncoskuner bnymncoskuner commented Jan 30, 2018

Hello,

I've been using your library as long as I've been using Angular (4+). Last year, around this time I'd been using AngularJs for a while and since Angular 2 was finally released, I decided to give it a try. It seemed a lot more complicated than AngularJs, and i18n was almost impossible for me to use. At that time, I had other projects to work on so I stopped using Angular 2.

Few months passed, I had a chance to join the Ng-Conf. At the conference, I found John Papa at a hall and asked him about i18n in Angular. He said there is a built-in solution. I checked it out and it was too complicated. Extracting files, dealing with xml .... Also, we'd been using a tool for i18n, and we've put all of our translations into a json file. So, built in i18n was not an ideal solution for me.
Then, I kept digging and came across your library (as it was named ng2-translate then). I, immediately, fell in love with it. It was super easy to include, configure and use. And, it used JSON! Since then, I've been using it for all of my angular projects (plus I just started using Ionic, and I included ngx-translate into that project as well).

You listed some of the issues with ngx-translate. I think the most important one is that if, somehow, a user cannot download translation file or there is an exception somewhere, you could end up with messed up screen. Other issues, for me, are not so important.

Also, another feature of ngx-translate I really like, is code translation. I could use TranslateService within my code to get any translation I want which I always need to do so.

Long story short, I'd love to see you to keep maintaining this library even if you spend little time on it. I don't think angular built-in i18n solution should be the only one. I think having alternatives is always better.

For license, I think companies would stop using it if you start charging new versions or they'll just use an old version which works just fine. It is because, purchasing a licence in a company is a painful process and I think most people would just avoid it and go for other solutions. Also, I have to mention that if a company buys a license, they expect 24/7 pro support. At least, mine does :) So, that would be hard to deal with.
For other alternative, you could get funding through donations or at least try it for a while and then go for paid license.

@davidefavia

This comment has been minimized.

Copy link

@davidefavia davidefavia commented Jan 30, 2018

Hi @ocombe,
first of all thanks for your hard work and for this open discussion.
I'm fine with option number 1 (few PRs merging, no new features), projects I'm working on don't present any critical issue within your library, so a maintenance mode could be fine.
The company I work for could probably afford a paid license but we have a lot of JavaScript stuff (vanilla, jQuery, Vue.js), it could be difficult to justify expenses just for few projects (~5%) using Angular.
I found difficult to use official i18n solution because of:

  • one bundle per locale,
  • impossibility to switch language at runtime without reloading the app,
  • xliff file IDs synchronization,
  • cannot translate inside code, only in templates.

If my personal issues could be addressed by the official i18n solution, I could switch without any problem.

@stefangrossmann

This comment has been minimized.

Copy link

@stefangrossmann stefangrossmann commented Jan 30, 2018

We started using “ngx-translate” at the company because it delivers exactly what we need:

  • The JSON format worked out of the box with our professional translation tool, and it is easy to read and to handle.
  • Switching the language during runtime helps our professional translators to find correct translations and to verify them.
  • We use our own Translate-Loader to combine translation sources. This way we for example can allow our customers to provide languages we don’t support by default.

But if we would need to buy a license, I think we would stop using it. It would be hard to argue to pay for it, if Angular itself has something for free. And I can confirm that the process of purchasing a license in a big company is a painful process.

I am not sure if you can make your project profitable with a paid license for commercial usage. Other models I know are, that there is a limited free version of a product and a commercial one with support, extended features and extended documentation. But because “ngx-translate” is easy to use and does exactly what it should, there is no need for us to pay for additional stuff ;-) :-/.

@vivainio

This comment has been minimized.

Copy link

@vivainio vivainio commented Jan 30, 2018

+1 for option 1. In the end everyone wants to be on the official solution, esp. since v6 seems to fix the biggest limitations (and that they wanted to fix those in the first place, i.e. it's not going to pursue "wrong" direction forever.

@peterpeterparker

This comment has been minimized.

Copy link

@peterpeterparker peterpeterparker commented Jan 31, 2018

First of all, thx @ocombe for your library and amazing work. I use ngx-translate in every single frontend development project I do, one of the first dependency I inject ;)

Furthermore to the simplicity of implementation, I use ngx-translate because supporting multi-languages is a must for all my projects.

My major concern, because my main app is a Ionic/Cordova app, is having the abilility to have only one bundle and to boot the app in the right language. If that would be possible in the future with i18n, well I might be open to the idea to migrate to it . If that will not be possible, there is no way that I gonna migrate to i18n, I can't boot for example an app in english, then switch to french and restart the mobile app, that would be a crazy user behavior.

About your question itself, I'm not a big company, just a single developper, so I could not tells you if they would be or not be open to a licence fee.

But maybe a third option, just throwing that idea out of loud, to the two you listed above would be a donation model or even maybe better to start a kickstarter? Like "I need xx'xxx euros for the next x years in which I gonna implement these and these features and perform support and bug fixes etc.".

@ocombe

This comment has been minimized.

Copy link
Collaborator Author

@ocombe ocombe commented Jan 31, 2018

Solution 1 is not "ditching it", just making sure it still runs on the current Angular and merging PRs that seem interesting or fix bugs. That's how it's been working for the past year.

@vivainio

This comment has been minimized.

Copy link

@vivainio vivainio commented Jan 31, 2018

@DenisVuyka The projects is already hosted under ngx-translate github team. There wouldn't need to be "transfer of ownership", just assign PR merge rights to some trusted lieutenants.

Truth be told, resources would still be better assigned as third party improvements to angular-i18n ecosystem (tools, hooks, what have you). That would provide some freedom of innovation outside Angular's strict quality policy while not diverging from the core offering

@bnymncoskuner

This comment has been minimized.

Copy link

@bnymncoskuner bnymncoskuner commented Jan 31, 2018

What about proposing to angular team to make this an official alternative to angular i18n? Angular team may offer two different solutions for i18n. Would this not be better?

@ocombe

This comment has been minimized.

Copy link
Collaborator Author

@ocombe ocombe commented Jan 31, 2018

This is not an option no.

@bnymncoskuner

This comment has been minimized.

Copy link

@bnymncoskuner bnymncoskuner commented Jan 31, 2018

Then, I think option 1 is the one. People don't expect much out of this library, because, most of the apps just need something as simple as ngx-translate to support i18n. Angular solution may be powerful and better, but often it is overkill and may be harder to manage.

@Bil0

This comment has been minimized.

Copy link

@Bil0 Bil0 commented Feb 1, 2018

attract more contributors and leveraging the community would be a good idea for making this lib live longer and keep it maintained, encouraging others to share ownership of the project can greatly reduce your own workload since you don't have enough time to review all PRs and issues. Maybe it'll take some times to do so but here's my suggestions:

  • It's difficult for someone unfamiliar with the codebase of the lib to gauge the difficulty of an issue (Only ~10% of the current 207 open issues are labeled).
  • Creating templates for PRs and issues, establish proper contributing guidelines with a clear Code of Conduct.

About:

I would need to make this library profitable somehow

I read an interesting article a few weeks ago about Why Funding Open Source is Hard,
so if you want to make this lib a business, changing the license is often the most suitable approach. Companies that rely only on open source projects and libraries are not willing to pay for a license, they'll seek for alternatives.

@ocombe

This comment has been minimized.

Copy link
Collaborator Author

@ocombe ocombe commented Feb 1, 2018

licensing a Pipe and a Service is a bit too much

If you think that it's the only thing that this library offers, sure. Not counting the time it takes to work on issues, edge cases and such. The time it took to research stuff, to create the library, bundle it, distribute it. The time it takes to write the tests, the plugins, to maintain the website, to write the documentation, the examples and to reply to people asking for help.
And my offering was more than just what exists right now, it was helpers for tests, better docs, better examples, taking care of the existing bugs, probably creating a forum for support (because github issues is not ideal for that), adding new functionalities, new tooling, and premium support.

If the license was for example 500$, how much time do you think that writing that library + its ecosystem of plugins would take you? Only a day? Maybe a week? How much are you paid for your job? If you work in the US, probably at least 500$/day.
For me that's a cheap bargain, you're getting the work done, and support if needed, and in exchange of a small fee you get to focus on the real value of your business instead of spending time reinventing the wheel.

The bugs that made you "loose so much time" could have been resolved by me instead of your team.

@web-dave

This comment has been minimized.

Copy link

@web-dave web-dave commented Feb 2, 2018

Love this project, @ocombe keep on maintaining. plz.
I'm fine with both options,
but option 1 would be more community like.
anyway, great important valuable job

@bnymncoskuner

This comment has been minimized.

Copy link

@bnymncoskuner bnymncoskuner commented Feb 2, 2018

If you think that it's the only thing that this library offers, sure.

I don't think he actually sees it that way, but I can see his point of view. Think of this way, consumers of this library are your customers, you are doing a great job and tremendous amount of work in order to deliver it but all they see is a service and a pipe. They don't really see what's going on under the hood. They never see the part of maintaining a library and keeping it stable. That's why people would think this way, and if you start charging for it, they'll just fork the library and make it a part of their project. Since, current version works for almost every app as is, they won't need to add new feature or fix some bugs. I think finding some collaborators and going with slow pace is the best option here.

@davidefavia

This comment has been minimized.

Copy link

@davidefavia davidefavia commented Feb 2, 2018

I can see lot of negativity and little respect for the work of @ocombe in this discussion. I really would like to see people saying today "I'm not gonna pay, I'll fork it", forking and maintaining their own version of the library, it's just a simple Pipe+Service, right? Please, do it, meanwhile I'm going to buy some popcorn to watch the show. 🍿 Probably the only thing people can do is just click on GitHub "Fork" button and stop then.
If we are not able or comfortable to pay to use his library (as it seems), just suggest to adopt option 1: whenever he will have time to merge PRs he will do it and many many thanks for his hard work in advance. Meanwhile he can concentrate on i18n for Angular core getting paid for it!

@ocombe

This comment has been minimized.

Copy link
Collaborator Author

@ocombe ocombe commented Feb 2, 2018

Thanks. I'm not against taking some other maintainers, but from experience people start "playing" maintainer but give up really fast when they see the amount of work for no reward.
If anyone is interested, let me know and I'll add you to the project.

@Maistho

This comment has been minimized.

Copy link

@Maistho Maistho commented Feb 5, 2018

I'd prefer it if Angular i18n would work better. I've been using both ngx-translate and official Angular i18n in two different large-scale projects, and in my experience it's actually been somewhat easier to get started with the official plugin. The main drawback has been no code translations, but it's coming soon! ❤️

If you feel like you would get more out of working on this project and related offerings I might pay for a license, but it really depends on the cost. If I can spend a couple of hours to convert a project to use Angular i18n instead I might do that instead of paying some monthly license cost. It's difficult to compete with "free", sadly.

It feels to me like Angular i18n is more geared towards larger more "enterprisey" businesses, while ngx-translate is geared more towards smaller projects. And, unfortunately for you, I also think that the larger businesses are more likely to pay for licenses than the smaller ones.

It really depends on your extra tooling and such in that case.
I'd definitely pay for a good tool that integrates really well with our git-based workflow and makes it easier to send off our JSON (or whatever format) translation files to translators.

Lastly, great job on both ngx-translate and Angular i18n. I hope that you'll be happy whichever way you choose.

@rowdyrabouw

This comment has been minimized.

Copy link

@rowdyrabouw rowdyrabouw commented Feb 12, 2018

@Maistho this might be an interesting tool for your translators: https://www.codeandweb.com/babeledit

@rowdyrabouw

This comment has been minimized.

Copy link

@rowdyrabouw rowdyrabouw commented Feb 12, 2018

@ocombe I love what you're doing with this project.

A big plus is the run-time change of language.

I use it in NativeScript projects so my users can switch the language easily.
With multiple bundles (Angular i18n) I would have to distribute multiple apps to the stores, "just" because the language is different.

@loicsalou

This comment has been minimized.

Copy link

@loicsalou loicsalou commented Feb 21, 2018

@ocombe ngx-translate is cool and efficient, it's pragmatic and I really like it.
IMO companies can pay for the service if they have a guarantee that the library will always be maintained. If you have several applications in production which use a library you don't want to be forced to change a library... unless you facilitate migration from ngx-translate to angular's implementation maybe ? if I know I can easily migrate from ngx-translate to Angular's solution I think I'll keep ngx-translate for some time, because it's perfect for what I'm doing and I know I can switch easily in case the lib disappears.
In case of doubt I guess a big company will probably choose "security" of a standard, which would in this case be @angular's implementation. As you are working for google it also seems to me that some kind of conflict may help you choose not to maintain the library eternally...
Personally after what you wrote above I must admit that Angular team seems to be taking seriously i18n topic for big companies (delegating translations to professional translator is a real concern) though I'm a bit disappointed that switching locale implies reloading the app. OK I do not expect a lot of our users to switch locale several times a day (a user in front office, discussing with end clients, might need this however).

As a developer I think I'll use ngx-translate for my personal projects as long as it's maintained. Regarding professional projects I think that, the day Angular's solution with i18n is OK for my needs I'll switch.

Hope this helps. Good luck and thanks for your great work !

@Matmo10

This comment has been minimized.

Copy link

@Matmo10 Matmo10 commented Feb 21, 2018

Maybe you could start an OpenCollective or some way for people to donate individually to the project. Maybe something like a Kickstarter where each threshold unlocks a new feature to be implemented or issue to be resolved. I feel like ngx-translate is already 90% done, it just needs a few final touches.

I'd like to use the official i18n solution, but it simply isn't flexible enough for me yet, and I'll keep using ngx-translate until it is. I don't see that being anytime soon, to be honest.

I would donate personally. Having to go through a corporate process of purchasing and dealing with licensing though (dealing with procurement teams, legal teams, etc) - I would probably just stay on the current free version rather than deal with that to be honest.

@lephyrus

This comment has been minimized.

Copy link
Contributor

@lephyrus lephyrus commented Mar 23, 2018

Bit late, but here's my feedback: We have a fairly large app at work which was written in AngularJS. When we started the migration to Angular 2, internationalization turned out to be a big challenge. We were using angular-translate with JSON files, runtime language switching, in-code translations, and ICU syntax. To make the long (and ongoing) migration to Angular feasible, we need all of this to work seamlessly across our hybrid app, so Angular's official solution was a long way off the mark. The only thing missing from ngx-translate, on the other hand, was the ICU syntax. Talking to Pascal Precht at a conference last year, he encouraged me to contribute to this library to add that feature, which I have done. ngx-translate was and continues to be crucial for the development of our app. Thanks again, @ocombe.

About the future:

  • I'd prefer to be on the official track, but the upcoming changes will still not make that realistic.
  • It looks to me like the long-term goal should be to make the official solution suit more scenarios, but ngx-translate will remain relevant for some time yet.
  • I can't say that paying for a licence would come easy, but it's not out of the question. My feeling is that donations could work out better, but I'm not speaking from experience.
  • As the maintainer of ngx-translate-messageformat-compiler, my biggest pain point would be the complicated handling of async translation loading. I love rxjs, but I have a hard time understanding the control flow for all of the edge cases (not that I've invested a ton of time, mind you). Users keep running into timing-related problems, in any case (lephyrus/ngx-translate-messageformat-compiler#21, lephyrus/ngx-translate-messageformat-compiler#20).
  • It's not like you owe anyone anything regarding this library - I'd say concentrate on what's interesting to you.
@CodeAndWeb

This comment has been minimized.

Copy link
Collaborator

@CodeAndWeb CodeAndWeb commented Mar 29, 2018

I am currently trying to help @ocombe with ngx-translate, getting the issues cleaned up, fixing smaller things. I don't want to see ngx-translate rot and die...

Shot information about me: My name is Andreas Löw, owner of CodeAndWeb GmbH. We create tools for developers - main focus is game development (TexturePacker) but we've recently created a JSON editor called BabelEdit which works with ngx-translate.

I'm a developer for quite a long time - started programming when I was 10... which means that I've 34 years of experience ;) My usual work is in C++, PHP for webpages and Javascript/Typescript.

I've been working on an Angular project for the last year - but I must admit this does not make me an expert. As I said: I have good knowledge in coding - but not about Angular in depth.

@ocombe Why don't you go to https://www.patreon.com ? It should be easy to setup and collect some money from donations.

@hamzapoly

This comment has been minimized.

Copy link

@hamzapoly hamzapoly commented Mar 30, 2018

Well I have one question, is there a way on Angulari18n for angular 5 to load .json source files ?
In my case we don't need to generate neither to extract as all the translations are pre-configured in a json file.
Thanks in advance

@DenysVuika

This comment has been minimized.

Copy link

@DenysVuika DenysVuika commented Mar 31, 2018

If anyone interested, I've started working on an alternative solution: https://www.npmjs.com/package/@ngstack/translate.

Not trying to make a framework out of a library, and keeping things very simple and small. Should cover most of the real-life scenarios as well as addressing the most common issues my team has been struggling with when using ngx-translate/core during the last year.

Live demos:

@tnicola

This comment has been minimized.

Copy link

@tnicola tnicola commented Apr 24, 2018

Hi @ocombe . First of all, congratulations for you success story and the awesome work you've done till now. I think ngx-translate it's a great library and I'd like if you didn't stop to mantain it. My company is thinking to move on and migrate to i18n but we didn't take a decision yet both for the migration effort that will take and for the missing features on i18n like code translation. I would like to ask you if it's worth to change for a big and already started project. If so, is there a guide to facilitate the process? Have you already decided a future for your library, will it be deprecated if i18n will fill the gap with the missing features?

@admir86

This comment has been minimized.

Copy link

@admir86 admir86 commented May 25, 2018

Hi @ocombe,
what is the final result of this discussion?
what's gonna happening with ngx-translate, once ivy is released and the official i18n is updated with features like translation in code?

@ocombe

This comment has been minimized.

Copy link
Collaborator Author

@ocombe ocombe commented May 25, 2018

I'll keep it alive (updating for new versions of Angular) since it'll still be the only way to change the language without reloading the app, and also because a lot of people who are using it probably don't want to refactor their code to replace that lib as long as it works for them.

@peterpeterparker

This comment has been minimized.

Copy link

@peterpeterparker peterpeterparker commented May 25, 2018

@ocombe not all heroes wear capes, merci ❤️

@vivainio

This comment has been minimized.

Copy link

@vivainio vivainio commented May 25, 2018

Seems there is no real documentation for js-driven i18n in Angular 6 docs. What's the best place to look?

@ngehlert

This comment has been minimized.

Copy link

@ngehlert ngehlert commented Feb 26, 2019

@anilgr you find everything here https://angular.io/guide/i18n

no you don't need angular cli for that

ionic 3 is an angular project as it uses angular :) it may not use the angular cli but it is still an angular project. i'm using the native translation in ionic 3 by myself

@Gokul-Pulsebeat

This comment has been minimized.

Copy link

@Gokul-Pulsebeat Gokul-Pulsebeat commented Mar 1, 2019

@ocombe Does Angular i18n and/or ngx-translate support AngularJS (version 1.x)? Can these services be downgraded in used in AngualrJS?

@Ghostbird

This comment has been minimized.

Copy link

@Ghostbird Ghostbird commented Mar 29, 2019

For me one of the great things about ngx-translate is the ability to load multiple translations with fallbacks, on the fly.

I use this approach:

  • global translations (these are always loaded first, mainly used for the list of languages.)
  • language translations (e.g. English)
  • country translations (e.g. override pants with trousers and color with colour in UK)

I think it is fine if only critical bugs are fixed. This library is stable and has all the functionality I need.

@broweratcognitecdotcom

This comment has been minimized.

Copy link

@broweratcognitecdotcom broweratcognitecdotcom commented May 14, 2019

ngx-translate is better than what comes with angular. We can't switch at this point. It's waaaay too late. otherwise we have zero issues with your library. it is great.

@VVKot

This comment has been minimized.

Copy link

@VVKot VVKot commented Jun 3, 2019

@ocombe Now that angular v8 with Ivy opt-in is out is there a new estimate on translation plans?

@ocombe

This comment has been minimized.

Copy link
Collaborator Author

@ocombe ocombe commented Jun 3, 2019

Once ivy is the default in google apps we will start working on the translation service for external users. So anywhere between soon and v9 :)

@leolcao

This comment has been minimized.

Copy link

@leolcao leolcao commented Jul 6, 2019

@ocombe, what is your plan about upgrading ngx-translate to support Angular 8.x?

@ocombe

This comment has been minimized.

Copy link
Collaborator Author

@ocombe ocombe commented Jul 6, 2019

it's supposed to work with v8 already

@dsebastien

This comment has been minimized.

Copy link

@dsebastien dsebastien commented Jul 17, 2019

Hello @ocombe,

I'm curious about the current state of things. What would you recommend for a brand new project? ngx-translate or angular i18n?

I find it hard to clearly see where I should be going..

@ocombe

This comment has been minimized.

Copy link
Collaborator Author

@ocombe ocombe commented Jul 17, 2019

For people waiting for runtime i18n with ivy: bad news, I had to leave the Angular team (budget cuts) and this means that i18n will get less attention.
Pete B. Darwin will work on it part time, but he also has a lot of other priority things on his list (like ngcc).
The current plan is to have translations working with ivy for v9 but only as a build step (like it is right now). This means that it's still going to be 1 build / locale for now, and there won't be code translations (only template translations).

Looks like ngx-translate still is the best choice for now 😕 I'll see what I can do on my free time to improve the lib. I might rewrite it from scratch for ivy because there's a lot of flaws in the current design that would require a complete rewrite to fix, and I think that we can use runtime translations from ivy to do a good part of the work (meaning better perf). We would loose the ability to change the language without reloading the app (or at least the templates), which I don't think it's too big of a deal (and for those who absolutely need this, then the current ngx-translate would still work).

@kolkov

This comment has been minimized.

Copy link

@kolkov kolkov commented Jul 17, 2019

WTF, Google have no money?!!

@ocombe

This comment has been minimized.

Copy link
Collaborator Author

@ocombe ocombe commented Jul 17, 2019

They are recruiting internally for the team, it's just the budget for external contractors like me that was over budget

@alessiostalla

This comment has been minimized.

Copy link

@alessiostalla alessiostalla commented Jul 26, 2019

@ocombe last time I tried the current ngx-translate does not work with the Ivy preview and AOT. And Ivy will become the default in the future, so that's going to be a problem.
I can help with development. However, we need the ability to switch the language, and doing so without reloading the whole app and without complicating the build is a big pro (though not absolutely necessary). I guess my ideal would be to have two strategies, the fast one requiring a reload, and the slower but more flexible one doing everything at runtime with no reloads.

@ocombe

This comment has been minimized.

Copy link
Collaborator Author

@ocombe ocombe commented Jul 30, 2019

If it doesn't work with ivy&aot then it's a bug that I should fix. I don't really see why that would be the case since ivy is supposed to be 99% compatible with view engine. @alessiostalla could you open an issue with a repro project that I could use to see what's the issue? Thanks!

@ngehlert

This comment has been minimized.

Copy link

@ngehlert ngehlert commented Jul 31, 2019

@ocombe that are some really sad news :( code translations not even in V9?... that was supposed to be in couple of major versions ago - and somehow always postponed.
I know it's not your fault^^ still just sad to hear after all, that (at least in my eyes) such an important feature seems to be completely ignored by the angular team.

Maybe it's time to go back to ngx-translate 👍

@vivainio

This comment has been minimized.

Copy link

@vivainio vivainio commented Jul 31, 2019

Since this thread is what is being used for "general discussion", I made a blog post on a possible alternative approach: https://dev.to/vivainio/trivial-typesafe-translations-in-angular-3aod

@ocombe

This comment has been minimized.

Copy link
Collaborator Author

@ocombe ocombe commented Jul 31, 2019

@ngehlert I'm going to work on some new tools / services for ivy, hopefully for v9.
Hold on for a few weeks while I figure things out, but I shall bring some good news to the community soon :)

@ocombe ocombe pinned this issue Jul 31, 2019
@bjornharvold

This comment has been minimized.

Copy link

@bjornharvold bjornharvold commented Aug 22, 2019

Great library! Have used it successfully for years. #gratitude. Fix the small issues and feature enhancements, bump the major version and charge $9.99 for it. Assume worst case scenario 10% of your 350K downloads upgrade (which they will), you just netted $350K. Charge for major versions going forward with a cheaper upgrade path for existing customers.

Thank you @ocombe

@ewok-janitor

This comment has been minimized.

Copy link

@ewok-janitor ewok-janitor commented Aug 22, 2019

Indeed. I can no longer wait for google to come up with a runtime i18n solution. I would pay more than $10, especially if there was an automated migration path.

@julianpoemp

This comment has been minimized.

Copy link

@julianpoemp julianpoemp commented Aug 22, 2019

Option 1. There are people that use your library in free open source projects.
@ocombe why don't you use opencollective to collect donations?

@alessiostalla

This comment has been minimized.

Copy link

@alessiostalla alessiostalla commented Aug 23, 2019

@ocombe I couldn't reproduce it. Maybe it depended on some Angular.next version that has been superseded.

@ocombe

This comment has been minimized.

Copy link
Collaborator Author

@ocombe ocombe commented Aug 23, 2019

So now that I left Google, I have some time to work on all the things that I wanted to do for so long. I'll be working part time on https://www.locl.app/. It will be the next gen library for i18n with a bunch of tools to go with that.
Since that represents a lot of work, some parts will be free (the lib most likely) and some will be a subscription or something like that. In any case it'll be free for open source projects.

I will also see if I have the time to work on ngx-translate to fix all the current issues and add some new features, and offer paid support (which could be part of the subscription to locl)

@bjornharvold

This comment has been minimized.

Copy link

@bjornharvold bjornharvold commented Aug 24, 2019

@ArielGueta

This comment has been minimized.

Copy link

@ArielGueta ArielGueta commented Sep 2, 2019

@ocombe thanks for your work!

@bjornharvold we migrate to Transloco. It's really awesome library.

@julianpoemp

This comment has been minimized.

Copy link

@julianpoemp julianpoemp commented Sep 3, 2019

@ocombe thanks for your work!

@bjornharvold we migrate to Transloco. It's really awesome library.

I migrated to transloco, too. It's very good and easy to migrate. Works with my translation files and the migration process took me only 15 minutes 😄 👍

@vmasek

This comment has been minimized.

Copy link

@vmasek vmasek commented Jan 7, 2020

I've got together a blog post about translations and i18n in Angular, it touches the topic from the perspective of the architecture. You could say that it is translations as a code, the best thing is that they are fully typed and lazy-loaded.

Feel free to have a look, migration from ngx-translate is pretty easy.

https://medium.com/angular-in-depth/angular-typed-translations-29353f0a60bc

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

Successfully merging a pull request may close this issue.

None yet
You can’t perform that action at this time.