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

RTL i18n/l10n support #176

Closed
aaronjudd opened this issue Oct 2, 2014 · 30 comments
Closed

RTL i18n/l10n support #176

aaronjudd opened this issue Oct 2, 2014 · 30 comments
Assignees
Milestone

Comments

@aaronjudd
Copy link
Contributor

RTL (right to left) support in internationalization / localizations.

Original discussion/proposal from @danielgindi

Now I want to start working on RTL support...
Which means basically two things:
1. Adding an "rtl" value in the localizations
2. CSS adjustments, base on that rtl attribute

Now Reaction has themes, but I'm guessing a theme is generic and not language-specific, and so a theme must contain the support for rtl languages,

I can think of two ways to do this:
1. Additional CSS files that will load when there's an rtl language loaded
2. Conditionally adding an "rtl" class on the body or html tag, and then having CSS adjustments based on that class

What do you think?
Any other idea?
@aldeed
Copy link
Contributor

aldeed commented Oct 2, 2014

I have no experience with RTL on web, but I know that tricky situations can arise with formatting. One simple thing we can do is add/remove rtl class from body element, allowing themes to provide overrides like this:

.rtl button {}

But it's likely there will also be cases where actual HTML elements will need to be reconfigured, which means template overrides. So a theme would also have to have the option to define some override templates that render different markup depending on rtl boolean from currently selected language.

Implementation ideas:

  • Add rtl boolean in localization files.
  • Define reactive method, ReactionCore.isRTL(), which reacts whenever locale changes.
  • Use method to add/remove body class: class="{{#if ReactionCore.isRTL}}rtl{{/if}}"
  • Theme packages can define CSS and override templates to handle the rest.

@danielgindi
Copy link
Contributor

So you theoretically support option #2...
Another thing is that when we use 3rd party UI libraries, or write UI code in JS, we need to make sure to have it support RTL. Many times it involves detecting "float:right" or "direction:rtl" on a parent element to determine flow direction.
I have experience with RTL-enabled UI so I can step in on that

@aaronjudd
Copy link
Contributor Author

@danielgindi @aldeed now that we have the pricing localization in as well, what do you think remains here? Do either of you want to take a whack at this?

@aaronjudd aaronjudd added this to the v0.2.3 milestone Nov 7, 2014
@danielgindi
Copy link
Contributor

Hey guys!
The load on me is balanced soon, so I'm stepping in to take care of this.
I'll be making sure that there's support for RTL from thr infrastructure, and that UI is fully RTLed too.
I'll keep you posted :)

@aaronjudd
Copy link
Contributor Author

@danielgindi sounds great. I think we've got most of the i18n and currency issues working fairly well. Looking forward to seeing what you come up with.

@aaronjudd aaronjudd modified the milestones: i18n & L10n, v0.2.4 Jan 19, 2015
@danielgindi
Copy link
Contributor

Yay! It will be ready in a few days :)

@danielgindi
Copy link
Contributor

Well it takes a little more time than I thought, as there is a big theme to adjust, and as I got engaged in the past month so I have my hands full.
We'll see Reaction in rtl soon!

@aaronjudd
Copy link
Contributor Author

👍 Looking forward to it. (and doesn't it always take more time than originally thought?)

@aaronjudd
Copy link
Contributor Author

Looking pretty darn good. However, I'm noticing one glitch. When changing from RTL to LTR not everything is updating for me (it does on refresh though).

Here's what it looks like after it switching back to LTR

screenshot 2015-02-19 10 19 52

I'm merging this into reactioncommerce/reaction-core#96. I'll take a look and see what's going on there.

@danielgindi
Copy link
Contributor

Man that's weird!
But after playing with it a little bit - it seems like a WebKit bug with the special columns css. It does not re-layout internally.
We can use the standard hacks to trigger a WebKit relayout, file a bugreport, or do both :-)

@aaronjudd
Copy link
Contributor Author

re: the pr comments, I can update the docs after everything look solid.

Was there a particular reason you used rtl.less as a separate import routine in the build configuration?

In any case, I've updated to use server/buildtools/module-definitions.js and added to the mixins.

Didn't see any difference in behavior (and I think that's how it should be)... but was wondering if you'd encountered some issue I'm not seeing. Still - it looks like it's the same functionally as before ( I just merged my changes into development, if you want to take a look.

@aaronjudd
Copy link
Contributor Author

Out of curiosity, does the site load in Hebrew by default for you (like it probably should) or English? I am thinking I had tested that locale detection, but at the moment mine keeps defaulting to en-us so I'm not sure how I tested it before. I had some chrome extension I used, but deleted it and now can't find it..

@danielgindi
Copy link
Contributor

Well I just thought it's natural to put it where the original bootstrap is,
but the end result is the same!

@danielgindi
Copy link
Contributor

I did have to specify Hebrew, but my Chrome is in English, and Chrome does not take the system locale for that...

@danielgindi
Copy link
Contributor

Something you did in that last PR broke the language menu - it does not load for me

@aaronjudd
Copy link
Contributor Author

did you do meteor reset? There's new data in the Shops.json that needs to load

@danielgindi
Copy link
Contributor

Yes!

@aaronjudd
Copy link
Contributor Author

@danielgindi does that mean it worked, or yes, like "duh, I did that" (and it still doesn't work)

@danielgindi
Copy link
Contributor

Oh yes!!! ;-)

@danielgindi
Copy link
Contributor

(Is that clearer?)

@aaronjudd
Copy link
Contributor Author

Awesome.

@aaronjudd
Copy link
Contributor Author

re: the refresh issue -> just occurred to me we probably need a Tracker.flush()

@danielgindi
Copy link
Contributor

From my tests it looks like a bug in refreshing CSS, I need to look into it more to say with certainty

@danielgindi
Copy link
Contributor

Yes it is a WebKit bug. Trying to add the class "rtl" to the document live in Chrome, then Ctrl+Z - keeps the bootstrap floats to the right.

These are actually not floats, but "-webkit-column", which I guess is still "-webkit" because it's not complete yet.

Trying to find a webkit-fix

@danielgindi
Copy link
Contributor

OK it seems like Bootstrap is using a very un-finished CSS3 feature there. I wonder why. There are dozens of articles out there blaming the browsers for being buggy and inconsistent about that feature...

@danielgindi
Copy link
Contributor

Update: Found the bug.
Nothing to have with the columns - but these are the main ones affected.
Chrome does not update "direction" after removing the "rtl" class. It still thinks that the HTML element has the direction: "rtl" when it actually supposed to take the default "ltr".
We can fix that by explicitly specifying "ltr" as the default

@danielgindi
Copy link
Contributor

@aaronjudd
Copy link
Contributor Author

well that works perfectly! love it when 15 characters of code answers one of life's big mysteries.

I'll update docs and close this issue when it's ready for the next release.

@danielgindi
Copy link
Contributor

Yeah it works great! I'm very satisfied with the result- where everything comes out real clean, and themes can be RTLed with almost zero effort.

Looking forward for the next release :-)

aaronjudd added a commit that referenced this issue Mar 24, 2015
Thanks to contributions from @danielgindi `right to left internationalization` is now supported.

Take a look at the Russian or Hebrew languages to see RTL in action.

 - Resolves #176

Also contributions from  @firstred and @epson121 added Dutch and Croatian translations.

Thanks to contributions from @lovetostrike, the initial `reactioncommerce:reaction-social` package has been published, which gives basic social sharing functionality.

 - Resolves #61
 - Resolves #281

- if there is neither a sessionCart nor a userCart, create a sessionCart
  * add sessionId to cart.sessions
  * auto insert/update userId if authenticated
  * observers to ensure cart always exists (ie after deletion)
- if sessionCart is a not a userCart return sessionCart
- if sessionCart just authenticated, add userId
- only return a user cart when authenticated
  * copy existing userCart(s) into sessionCart and remove userCart(s)
- if userCart just logged out, remove sessionId from userCart and create new sessionCart
- allow multiple sessionId per cart when userCart

TODO:

- realistically this may not be very solid way to handle sessions.
- Session handling will need a **close review in the future**.
- potential edge cases where multiple session/auth/merge actions to a cart may destroy the cart
- cart really should have mirrored client and server methods and be tested offline

Issue updates:

- Remove packages introduced in reactioncommerce/reaction-core#76
- Resolves #271
- Resolves #339
- Resolves #326
- Resolves #183
- Strategic updates for issue #16
- Strategic updates for issue #318
- Strategic updates for issue #76

   * dashboard enable/disable **guest checkout**
   * change default step to **guest checkout** or create/sign-in
   * store email for order - **after order completion if guest**
   * not visible after destroyed session (ie: refresh)
   * updated checkout and progress bar to use
     cart value instead of session

TODO:

- validation on email guest entry
- add account creation instructions to an order completion email
- potentially add third prompt for account creation after email (or promos,etc)
- order emails!
- use workflow states to control checkout ui flow.

Thanks to initial contributions from @prinzdezibel!

- use new Accounts collection (previously referred to as customers)
- create account on user create, or use a session specific account
- implement Template.dynamic handling of AddressBook edit/add/grid
- changes to checkout address handling, fix accounts context
- update addressBook forms to autoform-v0.5.0 compatible (autoform not upgraded)
- change accounts/shop `email` from string to `emails` array
  - `emails: {'address': options.email, 'verified': true}`
- changed Shops, Accounts email to an array `emails`
- userAccountsDropdown icon for orders, profile
- user view of order history

TODO:

- merge session accounts to user account upon email confirmation (and email saved on cart)
- reduce / cleanup garbage sessions  (merge will help)
- session / accounts/ cart garbage collector
- account profile / settings
- on account creation / login  with password
    - if confirmed account creation email
      - create a account collection record with this userId
      - update all orders with matching email to match this userId
      - copy all order addresses into Accounts.profile.addressBook
      - copy all social / email info to Accounts.
      - users collection locked down, nothing exposed to client, used for authentication only
    - else
      - if there are more orders with this email
      - display on order view "Add order"

* moves user orders from cart/checkout folder to dashboard/orders
* add message for confirmation of email
* authenticated user can see all orders where userId in list view
* admin can see all in list view
* userAccountsDropdown icon for orders
* add cartId to Orders (instead of using cartId as orderId)

TODO:

- integrate the admin view of list into dashboard admin flow
- this is possibly a breaking change to the orders dashboard.
- remove sessionId from orders on logout

* updates to handling settings from registry (public, private)
* rename and move settingGeneral to shop/settings
* rename and move settingsAccounts to shop/accounts

**Multi-shop/vendor**

* shop account updates to prep multi-shop dashboard
* shopId added to cart.items (variants)

Issue updates:

- Strategic updates for issue #236
- Strategic updates for issue #327

* added settings.public to publish public settings to ReactionCore.xxx

Thanks to contributions and docs from @spencern

- Test coverage for product methods
- Fix, add coverage for core methods

* Upgrade to Meteor 1.0.4.2
* Implements `check` and `audit-argument-checks`
* Implements `browser-policy`
* Fixed footer layout pages loading.
* Updates CFS, removes FileStorage collection.
* **Contributions from @aldeed @prinzdezibel @spencern @boboci9 @evliu @ceh @gouthamve @KEFIRCHIK @epson21 @firstred
**
aaronjudd added a commit that referenced this issue Dec 3, 2015
aaronjudd added a commit that referenced this issue Dec 3, 2015
Thanks to contributions from @danielgindi `right to left internationalization` is now supported.

Take a look at the Russian or Hebrew languages to see RTL in action.

 - Resolves #176

Also contributions from  @firstred and @epson121 added Dutch and Croatian translations.

Thanks to contributions from @lovetostrike, the initial `reactioncommerce:reaction-social` package has been published, which gives basic social sharing functionality.

 - Resolves #61
 - Resolves #281

- if there is neither a sessionCart nor a userCart, create a sessionCart
  * add sessionId to cart.sessions
  * auto insert/update userId if authenticated
  * observers to ensure cart always exists (ie after deletion)
- if sessionCart is a not a userCart return sessionCart
- if sessionCart just authenticated, add userId
- only return a user cart when authenticated
  * copy existing userCart(s) into sessionCart and remove userCart(s)
- if userCart just logged out, remove sessionId from userCart and create new sessionCart
- allow multiple sessionId per cart when userCart

TODO:

- realistically this may not be very solid way to handle sessions.
- Session handling will need a **close review in the future**.
- potential edge cases where multiple session/auth/merge actions to a cart may destroy the cart
- cart really should have mirrored client and server methods and be tested offline

Issue updates:

- Remove packages introduced in reactioncommerce/reaction-core#76
- Resolves #271
- Resolves #339
- Resolves #326
- Resolves #183
- Strategic updates for issue #16
- Strategic updates for issue #318
- Strategic updates for issue #76

   * dashboard enable/disable **guest checkout**
   * change default step to **guest checkout** or create/sign-in
   * store email for order - **after order completion if guest**
   * not visible after destroyed session (ie: refresh)
   * updated checkout and progress bar to use
     cart value instead of session

TODO:

- validation on email guest entry
- add account creation instructions to an order completion email
- potentially add third prompt for account creation after email (or promos,etc)
- order emails!
- use workflow states to control checkout ui flow.

Thanks to initial contributions from @prinzdezibel!

- use new Accounts collection (previously referred to as customers)
- create account on user create, or use a session specific account
- implement Template.dynamic handling of AddressBook edit/add/grid
- changes to checkout address handling, fix accounts context
- update addressBook forms to autoform-v0.5.0 compatible (autoform not upgraded)
- change accounts/shop `email` from string to `emails` array
  - `emails: {'address': options.email, 'verified': true}`
- changed Shops, Accounts email to an array `emails`
- userAccountsDropdown icon for orders, profile
- user view of order history

TODO:

- merge session accounts to user account upon email confirmation (and email saved on cart)
- reduce / cleanup garbage sessions  (merge will help)
- session / accounts/ cart garbage collector
- account profile / settings
- on account creation / login  with password
    - if confirmed account creation email
      - create a account collection record with this userId
      - update all orders with matching email to match this userId
      - copy all order addresses into Accounts.profile.addressBook
      - copy all social / email info to Accounts.
      - users collection locked down, nothing exposed to client, used for authentication only
    - else
      - if there are more orders with this email
      - display on order view "Add order"

* moves user orders from cart/checkout folder to dashboard/orders
* add message for confirmation of email
* authenticated user can see all orders where userId in list view
* admin can see all in list view
* userAccountsDropdown icon for orders
* add cartId to Orders (instead of using cartId as orderId)

TODO:

- integrate the admin view of list into dashboard admin flow
- this is possibly a breaking change to the orders dashboard.
- remove sessionId from orders on logout

* updates to handling settings from registry (public, private)
* rename and move settingGeneral to shop/settings
* rename and move settingsAccounts to shop/accounts

**Multi-shop/vendor**

* shop account updates to prep multi-shop dashboard
* shopId added to cart.items (variants)

Issue updates:

- Strategic updates for issue #236
- Strategic updates for issue #327

* added settings.public to publish public settings to ReactionCore.xxx

Thanks to contributions and docs from @spencern

- Test coverage for product methods
- Fix, add coverage for core methods

* Upgrade to Meteor 1.0.4.2
* Implements `check` and `audit-argument-checks`
* Implements `browser-policy`
* Fixed footer layout pages loading.
* Updates CFS, removes FileStorage collection.
* **Contributions from @aldeed @prinzdezibel @spencern @boboci9 @evliu @ceh @gouthamve @KEFIRCHIK @epson21 @firstred
**
aaronjudd pushed a commit that referenced this issue Dec 3, 2015
v0.7.0 - JS Conversion, layout.workflows, reaction-accounts, UIX
cmbirk pushed a commit to cmbirk/reaction that referenced this issue Aug 18, 2019
…e-cloudinary

chore: latest cloudinary plugin (operator UI update)
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

Successfully merging a pull request may close this issue.

3 participants