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

Use LocalizationService instead of ui.Text #39

Open
bjarnef opened this issue Jun 25, 2015 · 10 comments
Open

Use LocalizationService instead of ui.Text #39

bjarnef opened this issue Jun 25, 2015 · 10 comments

Comments

@bjarnef
Copy link
Collaborator

bjarnef commented Jun 25, 2015

ui.Text is deprecated, so we should use LocalizationService.

https://twitter.com/Shazwazza/status/613986522631667712

@warrenbuckley
Copy link
Member

Thanks for highlighting this @bjarnef looks like I need to get onto this at some point then. Will it be backwards compatible do we know?

@bjarnef
Copy link
Collaborator Author

bjarnef commented Jul 13, 2015

@warrenbuckley I am not sure how it will be backwards compatible - if it doesn't handle that, I think we could check for the Umbraco version?

I guess Shannon knows 👍

@Shazwazza
Copy link

You can still use ui.Text... it is backward compatible, just deprecated. It actually calls into LocalizationService.Text

... It would be impossible to make something new backward compatible btw unless i had a time machine :)

@bjarnef
Copy link
Collaborator Author

bjarnef commented Aug 19, 2015

Okay, I was just wondering if LocalizationService.Text had fallback for earlier version of Umbraco 7, which just used ui.Text.

@Shazwazza
Copy link

No, if you use new APIs that don't exist in previous versions it would never work. We cannot create 'fallback' APIs for ones that don't exist already :P

@bjarnef
Copy link
Collaborator Author

bjarnef commented Aug 19, 2015

So should we stick to ui.Text or check for the Umbraco version if switching to the new API?

@Shazwazza
Copy link

You can either keep using ui.Text for now for your packages, or you can do some compat checks in your packages or you can release different versions of your packages for different umbraco versions, or you can make your package dependent on certain versions of Umbraco (i.e. Articulate will make you use the latest Umb version normally... that is the way that I am supporting that project). In v8, ui.Text will not exist.

@warrenbuckley
Copy link
Member

@bjarnef let me know on what approach you want to adopt.

As obviously in current version we do a lot of work of merging of keys into lang files on app startup, but should I do a version check if newer than 7.3, use the lovely auto lang key merge in 7.3 thats now available & continue to use ui.Text??

Or do we make latest version breaking changes & dependant on latest version of Umbraco?

@bjarnef
Copy link
Collaborator Author

bjarnef commented Aug 19, 2015

@warrenbuckley I am thinking maybe do a check if newer than 7.3 .. and then maybe at the same time do a check if it should use the new LocalizationService.Text, if lower than 7.3 use ui.Text?

Then maybe later for a major version of Analytics only support Umbraco 7.3+ ... or what do you think?

@warrenbuckley
Copy link
Member

Not sure to be honest & little busy at the moment to do anything about it. So if you have an idea & want to implement it in a PR then go for it.

But until I can find/make some time for this I won't get a chance to look at it currently, so feel free to decide.

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

3 participants