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

Localisation of date and time in the activity tables #632

Open
lcharette opened this issue Feb 2, 2017 · 9 comments
Open

Localisation of date and time in the activity tables #632

lcharette opened this issue Feb 2, 2017 · 9 comments
Assignees
Labels
internationalization Related to the localization feature
Milestone

Comments

@lcharette
Copy link
Member

No description provided.

@lcharette lcharette added internationalization Related to the localization feature V4 labels Feb 2, 2017
@lcharette lcharette added this to the 4.0 milestone Feb 2, 2017
@alexweissman alexweissman removed the V4 label Jul 14, 2017
@lcharette lcharette modified the milestones: 4.x, 4.3.0, 4.2.0 Dec 16, 2017
@lcharette
Copy link
Member Author

Looks like Carbon doesn't support defining our own locale strings and only support the setlocale php function. This is clearly not reliable as it depends on the locale installed on the system, which contradict the file based localization provided by UF. French support for dates would required it installed on the system even if it's "available" as a UF locale.

So unless someone as an idea how we could solve this, we'll probably require our own fork of Carbon...

FYI, this could probably be done using Moment.js, but that would mean handling dates at Handlebar level...

@lcharette
Copy link
Member Author

This could be useful : https://github.com/jenssegers/date

@Silic0nS0ldier
Copy link
Member

It looks as though they already took a stab at it. Git blame seems to suggest its used for the diffForHumans translations, which it is. Pity they didn't extend it to everything else.
https://github.com/briannesbitt/Carbon/blob/master/src/Carbon/Carbon.php#L1093-L1170

@lcharette
Copy link
Member Author

This could be useful : https://github.com/jenssegers/date

I tested it out. Works great. Every questions regarding Laravel and localized date points to this package. All that would need to be done is to add it to core and set the "date" locale when loading the overall locale. Should be easy do rewrite Laravel ServiceProviders to our own format.

Only problem, it doesn't use the same locale identifier as UF. Would requires some trick for us to make it work with UF, like the locale metadata thing we talked before...

@Silic0nS0ldier
Copy link
Member

Only real difference in local identifier is _ vs. -. Easy to switch. Shame it doesn't support fallback logic though (I mean, to the same degree we have).

@lcharette
Copy link
Member Author

lcharette commented Dec 24, 2017

Hum? We use fr_FR while they use simply fr..

@Silic0nS0ldier
Copy link
Member

That's because they are technically different translations. Ours is more specific. We'll need to look though the other locales the user requested before resorting to lowering specifity.

@lcharette
Copy link
Member Author

That's why I brought up the metadata thing. For example each locale could have a simple YAML/json file containing description and settings about the locale :

  • Locale name
  • English name
  • Base / fallback language
  • Translator name
  • Plural rule
  • Date locale

Actually, I found the original issue (and get now why I couldn't find it earlier) : userfrosting/i18n#4

@alexweissman
Copy link
Member

I'd actually prefer if we used the more generic language codes. If we had @lcharette's fallback language metadata, we could make this change in a backwards-compatible way.

@lcharette lcharette self-assigned this Mar 28, 2018
@lcharette lcharette modified the milestones: 4.2.0, 4.3.0 Aug 21, 2018
@lcharette lcharette modified the milestones: 4.3.0, 4.4.0 Jan 14, 2019
@lcharette lcharette modified the milestones: 4.4.0, 4.3.x Mar 14, 2020
@lcharette lcharette modified the milestones: 4.6.x, No Milestone, 5.1.0 Nov 25, 2023
@lcharette lcharette moved this to Todo 5.1.0 in UserFrosting Task Planner Nov 26, 2023
@lcharette lcharette moved this from Todo 5.1.0 to Todo 5.2.0 in UserFrosting Task Planner Feb 10, 2024
@lcharette lcharette modified the milestones: 5.1.0, 5.2.0 Feb 17, 2024
@lcharette lcharette moved this from Todo 5.2.0 to Not Started in UserFrosting Task Planner Apr 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
internationalization Related to the localization feature
Projects
Status: Not Started
Development

No branches or pull requests

3 participants