Multilingual instances

Will chat with @maikel about your request @lin_d_hop and get back to you :slight_smile:

I had a chat with Danni and we would like to estimate the estimation first. :wink:

  • I need to look into the current state and what’s still missing (3h)
  • Estimate the work on unfinished internationalisation (1h)
  • Estimate the work on flexible Javascript translations (1h)
  • Estimate UI changes to choose another language (1h)
  • Research current ways for multi-language db models (2h)
  • Estimate the integration of the top contenders (4h)
  • Summarise the results in a nice document (2h)

That are 14h for the estimates which should give us a good understanding of what is to do and be detailed enough for a grant application. The research should also speed-up the development, because most questions have been asked already. That said, you never know where hurdles are hiding.

3 Likes

Nice estimate estimate :slight_smile:
@NickWeir @Sara @mags Are we happy to go ahead with this estimate in preparation for the HOWL funding application? I would hope that the implementation costs could be shared with @CynthiaReynolds and others.

We are still working on funding (we will know more in December) but we will happily go in on it to the extent that we can.

yes I am happy for us to commit to this if @Sara is OK with it. Thanks Maikel

Totally fine with me!

Great. @danielle @maikel When you get the time would you do this estimate based on the estimate estimate please? :slight_smile: Thanks!

1 Like

@maikel let’s chat about timing of this on Friday, taking into consideration the standing orders work you’re doing as well.

OK, so we’ve scheduled for @maikel to take a break from standing orders next week and spend his 2 days getting this estimate done (alongside of your remaining PR @lin_d_hop). So by next Friday you should have a breakdown under an epic in GitHub that shows the work to be done, the issues within that epic, and estimates on all of the tasks + testing + a round of changes based on feedback + deployment.

@maikel let’s chat about the estimates to add for those non-dev sections of the quote once you’ve done your dev estimates.

Cheers all!

1 Like

First Draft (22 October 2016)

Updated: 26 October 2016

The task list:

  • Look into the current state and what’s still missing (3h)
  • Estimate the work on unfinished internationalisation (1h)
  • Estimate the work on flexible Javascript translations (1h)
  • Estimate UI changes to choose another language (1h)
  • Research current ways for multi-language db models (2h)
  • Estimate the integration of the top contenders (4h)
  • Summarise the results in a nice document, broken down into small tasks (2h)

Work done: 9 of 14 hours

Results:

Outstanding work for multi-language interface

I found 83 files that contain language and need placeholders. (8 hours)

The “open” and “closed” icons still need to be replaced.
We need to discuss and decide which icons to use (3h).
And we need to replace these icons in the current symbol font (3h).

We need to pre-compile a Javascript locale file for each language.
That requires one asset file per language.
We can then compile only those locales defined in the app configuration. (4h)

The Javascript lacks a fall-back feature to show text of the default locale
if the selected locale doesn’t have the translated text.
For example, if the British English translation is not complete, the missing
parts would be displayed in Australian English. (6h)

The previous three tasks could be solved by: https://github.com/fnando/i18n-js
The documentation is good, it’s actively developed and the author works for Heroku. Using this gem is probably much better than developing everything on our own. Just for the worst case that we try to do this for a few hours and find out that it doesn’t work, I would add a worst case estimate (3h)

We need a user interface to switch the language.
That could be a simple button in the navigation bar.
It sets the new locale for the user and then reloads the page in the new language.
The Javascript UI just uses the asset the was loaded depending on the locale setting. (8h)

Optionally, the UI would probably look better if a designer could work on that. (8h)

In the end of this round, we need to test everything, get feedback and react on that. (6h)

Total: 49 hours

Outstanding work for multi-language data

I found only two solutions to store multi-language data in the database:

Globalize seems to be the most popular solution (968,446 downloads) while Hstore Translate (43,269 downloads) is bound to a Postgresql feature. There is also the Spree Globalize gem for newer Spree versions (3.1+). We use Spree 1.3 at the moment. And there is a nice Railscast introcution to Globalize.

Globalize changes our database layout quite a bit. It will add extra work for all future development. Whenever we introduce or change a new data field that should be translatable, we need to change the translation tables as well. Planned Spree upgrades are better done before introducing multi-language features.

Fields to translate

The essentials:

  • product name
  • product type / category (taxon)
  • product properties
  • amount unit
  • delivery method
  • shipping method name
  • payment method name
  • tax category name
  • enterprise fee name
  • enterprise description
  • shop messages
  • group description

For discussion:

  • ~ enterprise names
  • ~ enterprise images
  • ~ enterprise contact details
  • ~ addresses (countries, states, suburbs)
  • ~ group names
  • ~ group images
  • ~ group contact details
  • ~ order cycle name
  • ~ product unit
  • ~ product scale

The tasks:

  • Discuss data structure change with other developers (10h)
  • Add Globalize to the OFN project (2h)
  • Change model classes (5h)
  • Add initial database migration (5h)
  • Possible difficulties / conflict solving (20h)
  • Denote translatable fields (5h)
  • Add language switcher to the admin interface (6h)
  • Final testing and reacting to feedback (11h)

Total: 64 hours

Total of both projects: 113 hours

Doesn’t seem too bad. I expected this project to be bigger.

Not included:

  • Multi currency setup
  • Locale dependent OpenStreetMaps settings.

Resources

Files containing language:

app/views/admin/enterprise_roles/_enterprise_role.html.haml
app/views/admin/enterprise_roles/_form.html.haml
app/views/admin/enterprise_roles/index.html.haml
app/views/admin/enterprises/_actions.html.haml
app/views/admin/enterprises/_change_type_form.html.haml
app/views/admin/enterprises/_enterprise_user_index.html.haml
app/views/admin/enterprises/_new_form.html.haml
app/views/admin/enterprises/edit.html.haml
app/views/admin/enterprises/form/_about_us.html.haml
app/views/admin/enterprises/form/_address.html.haml
app/views/admin/enterprises/form/_contact.html.haml
app/views/admin/enterprises/form/_enterprise_fees.html.haml
app/views/admin/enterprises/form/_images.html.haml
app/views/admin/enterprises/form/_inventory_settings.html.haml
app/views/admin/enterprises/form/_payment_methods.html.haml
app/views/admin/enterprises/form/_primary_details.html.haml
app/views/admin/enterprises/form/_shipping_methods.html.haml
app/views/admin/enterprises/form/_social.html.haml
app/views/admin/enterprises/form/_tag_rules.html.haml
app/views/admin/enterprises/form/_users.html.haml
app/views/admin/enterprises/form/tag_rules/_default_rules.html.haml
app/views/admin/enterprises/index.html.haml
app/views/admin/enterprises/new.html.haml
app/views/admin/enterprises/welcome.html.haml
app/views/admin/order_cycles/_exchange_form.html.haml
app/views/admin/order_cycles/_exchange_supplied_products_form.html.haml
app/views/admin/order_cycles/_form.html.haml
app/views/admin/order_cycles/_name_and_timing_form.html.haml
app/views/admin/order_cycles/_row.html.haml
app/views/admin/order_cycles/_simple_form.html.haml
app/views/admin/producer_properties/_form.html.haml
app/views/admin/variant_overrides/_controls.html.haml
app/views/admin/variant_overrides/_filters.html.haml
app/views/admin/variant_overrides/_loading_flash.html.haml
app/views/admin/variant_overrides/_show_more.html.haml
app/views/checkout/_shipping_ship_address.html.haml
app/views/spree/admin/products/_distributors_form.html.haml
app/views/spree/admin/products/bulk_edit/_indicators.html.haml
app/views/spree/admin/products/bulk_edit/_products.html.haml
app/views/spree/admin/products/bulk_edit/_products_product.html.haml
app/views/spree/admin/products/bulk_edit/_products_variant.html.haml
app/views/spree/admin/products/bulk_edit/_save_button_row.html.haml
app/views/spree/admin/products/product_distributions.html.haml
app/views/spree/admin/variants/_autocomplete.js.erb
app/views/spree/order_mailer/invoice_email.html.haml
app/views/spree/products/_source.html.haml

app/views/admin/business_model_configuration/edit.html.haml
app/views/admin/cache_settings/show.html.haml
app/views/admin/contents/edit.html.haml
app/views/admin/enterprises/_admin_index.html.haml
app/views/admin/enterprises/form/_business_details.html.haml
app/views/admin/enterprises/form/_shop_preferences.html.haml
app/views/admin/order_cycles/_advanced_settings.html.haml
app/views/admin/producer_properties/index.html.haml
app/views/map/index.html.haml
app/views/producer_mailer/order_cycle_report.text.haml
app/views/spree/admin/orders/_invoice_table.html.haml
app/views/spree/admin/orders/bulk_management.html.haml
app/views/spree/admin/orders/edit.html.haml
app/views/spree/admin/orders/invoice.html.haml
app/views/spree/admin/overview/_enterprises_header.html.haml
app/views/spree/admin/overview/_enterprises_hubs_tab.html.haml
app/views/spree/admin/overview/_order_cycles.html.haml
app/views/spree/admin/products/bulk_edit/_filters.html.haml
app/views/spree/admin/reports/bulk_coop.html.haml
app/views/spree/admin/reports/sales_tax.html.haml
app/views/spree/admin/reports/xero_invoices.html.haml

app/assets/javascripts/templates/admin/info_dialog.html.haml
app/assets/javascripts/templates/admin/links_dropdown.html.haml
app/assets/javascripts/templates/admin/modals/tag_rule_help.html.haml
app/assets/javascripts/templates/admin/new_tag_rule_dialog.html.haml
app/assets/javascripts/templates/admin/panels/enterprise_package.html.haml
app/assets/javascripts/templates/admin/panels/enterprise_producer.html.haml
app/assets/javascripts/templates/admin/panels/enterprise_status.html.haml
app/assets/javascripts/templates/admin/panels/exchange_supplied_products.html.haml
app/assets/javascripts/templates/admin/panels/exchange_tags.html.haml
app/assets/javascripts/templates/admin/tag_rules/filter_order_cycles_input.html.haml
app/assets/javascripts/templates/admin/tag_rules/filter_payment_methods_input.html.haml
app/assets/javascripts/templates/admin/tag_rules/filter_products_input.html.haml
app/assets/javascripts/templates/admin/tag_rules/filter_shipping_methods_input.html.haml
app/assets/javascripts/templates/out_of_stock.html.haml
app/assets/javascripts/templates/single_line_selectors.html.haml
2 Likes

thanks for the great work and detailed info @maikel

The open/closed icons can likely come from FontAwesome.io - we could use two different icons, or one icon two colours. I think something very simple is the best way to convey the idea across all languages.
Maybe something like this:


for reference these are here: cart and clock
they also have a cart with a plus in it.

Thanks @maikel for splitting up the whole task list. Kudos !!
For Indian OFN system to succeed language would play a key role and I would try to bounce this of a few OpenSource contributors who work on languages specifically to Mapping !!
Btw, we also need to account changes in OpenStreetMaps also right to localise the maps ?

Thanks @maikel! Really appreciate you changing tasks so we can get this rolled on a bit;.

UK will be able to contribute some of this cost but this is a project that needs to be co-budgeted. I have set up a bucket on cobudget for us to start filling:
http://cobudget.co/#/buckets/809

So once this is filled we can ask the devs to add this to the pipeline. Cough up your $$$ people :smiley:

1 Like

We are still awaiting funding, have been coasting on private donations so far… (hoping for good news in december) but will put in what we can for now in the bucket.
@tschumilas any chance Canada wants to pitch in?

For sure eventually Canada needs to be a multilingual instance. Unfortunately right now we don’t have any funding. And frankly, importing csv files would be a priority for us right now (we don’t have money for that either.) BUT - we are also are busy writing proposals and trying to do fundraising. So I’d like to stay in this loop and if we can support this we would.

1 Like

Slovenian instance really have to be multilangual. For now we have problem setting up Slovenian translation (also because file on transifex does not include all strings).
I am trying to get some founding, but have to be patient.

1 Like

@tschumilas we have a channel to discuss the multilingual needs on Slack, any chance you can sign up there to follow the discussion? I realize that Canada does not have funding at the moment to contribute, but it would be great to have your input in other ways :wink:

BTW, Slack is very user friendly, do not worry about having to learn a whole new tech :wink: I sent you an invite by email

ping @lin_d_hop

1 Like

For the “Spain” instance we’ll need this too: Castellano & Catalan just to start.

1 Like

For Belgium this is also essential. I’ll try to help there :slight_smile:

1 Like

Hi Everyone,
Please can we all comment on the above. Do the above fields need translations within an instance?
@NickWeir could you confirm with our funding user on this?

We’re starting work on this in the coming weeks!