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

Decide about ZLanguage #3328

Closed
craigh opened this issue Dec 26, 2016 · 8 comments
Closed

Decide about ZLanguage #3328

craigh opened this issue Dec 26, 2016 · 8 comments
Assignees
Milestone

Comments

@craigh
Copy link
Member

craigh commented Dec 26, 2016

Either remove and replace or continue usage somewhow

@craigh craigh added this to the 1.4.5 milestone Dec 26, 2016
@craigh craigh self-assigned this Dec 26, 2016
@Guite
Copy link
Member

Guite commented Dec 27, 2016

I guess the only "interesting" method it contains is getInstalledLanguages()??

@Guite
Copy link
Member

Guite commented Dec 27, 2016

We are using $request->getLocale() already instead of ZLanguage::getLanguageCode(), right?

Symfony offers better selectors for countries and language, so we might consider using these instead of the old countryMap/languageMap stuff.

But I think two things from ZLanguage are useful:

  1. Determining a list of installed languages. Maybe we can provide a form type for that as a replacement 🤔
  2. Detecting the browser language. Don't know whether Symfony offers something similar we could use ❓

@Guite
Copy link
Member

Guite commented Dec 28, 2016

Maybe we can provide a form type for that as a replacement 🤔

This would be consequent, as we do so for locales, too.

@Guite Guite modified the milestones: 1.4.5, 1.4.6, 1.4.7 Dec 28, 2016
@craigh craigh mentioned this issue Jan 1, 2017
Merged
@craigh
Copy link
Member Author

craigh commented Jan 2, 2017

looks like we can use PHP's Intl component. Since it is a php extension, it requires the server to have it installed (or the user to work with their provider to do so). Symfony provides a compatibility layer if the extension isn't installed, but this only works for the default locale of en. So, the Core wouldn't break if it wasn't installed - it simply wouldn't provide proper information if the desired locale is not en.

We would still need to provide a method to determine the installed languages. I see two options for this:

  1. the same as now - scan the /locale dir for locale definitions.
  2. scan the /translations directory and parse the domain names for the locales.

Because I think that the Intl component takes care of all the "other" stuff that the locale definitions was used for, it makes sense to me to eliminate that and use the second option. But because I don't know anything about how that data was used before, or the need for this data in the future, I don't really know.

I need more input about this.

@cmfcmf @rallek @shefik @Guite @Portugao

@Guite
Copy link
Member

Guite commented Jan 2, 2017

If Intl is not available the core could at show a notification about this to the admin.
As Symfony pushes the usage of this PHP component I vote 👍 for adopting it, too.

@craigh
Copy link
Member Author

craigh commented Jan 3, 2017

@rallek
Copy link
Contributor

rallek commented Jan 4, 2017

I can not really add something important in this discussion. One advantage I cann see myself in the locale.ini what is configured for the laguage. But I do not know if that is used somewhere else than gettext.

Might be I do not get the point. In this case you can forget my thoughts ;-)

@craigh
Copy link
Member Author

craigh commented Jan 6, 2017

closed by #3366

@craigh craigh closed this as completed Jan 6, 2017
@craigh craigh modified the milestones: 1.4.6, 1.4.7 Jan 6, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants