Giter Site home page Giter Site logo

Comments (10)

herbdool avatar herbdool commented on July 28, 2024

Just spun up a core d7 site and compared with Backdrop core and I see what you mean now. I haven't looked further into this but wondering what is the difference between textgroup and context and why it was taken out (I assume this happened early on in d8 dev).

I think I'd need to see the historical discussion to decide on whether it's something to bring back or not.

from i18n.

indigoxela avatar indigoxela commented on July 28, 2024

what is the difference between textgroup and context

Context is used for t() to prevent overlapping translations (ambiguous / short strings).

Textgroup is used by i18n (don't actually know any other module) to separate/split export and import and string refresh (textgroups seem pretty important for i18n_strings).

Yes, that was ripped out pretty early in D8: https://www.drupal.org/project/drupal/issues/1188430

But I think it has some value.

from i18n.

herbdool avatar herbdool commented on July 28, 2024

There's a lot to digest. I'd be curious to know what Gabor thought was the better option for d7 if not textgroup.

I guess there are two approaches in my mind:

  1. implement textgroups in i18n for it's own modules so that it makes it easier to get it all up and running. So far it seems like core works well enough without it. Longer term find a way to deprecate textgroups for somethng better (whatever that is).
  2. Or, find a way to strip out all textgroup functionality from i18n. Perhaps the location column could be used better instead (from what I gather in this part of the thread https://www.drupal.org/project/drupal/issues/1188430#comment-4626010).

from i18n.

herbdool avatar herbdool commented on July 28, 2024

Looking into this again (while looking into webform_localization which relies on i18n_string sort of). This issue might provide a clue to what we could do to move away from textgroups if we decide to leave them out: https://www.drupal.org/project/i18n/issues/1191662

Steps:

  • We need to create a 'i18n_string_text' table and move all the translations there, included the source language. So we'll have a 'i18n_string' with string metadata and 'i18n_string_text' with source text and translation for every language.
  • Rework the data storage and retrieving functions that will be simplified by this new schema. Luckily most of this has been encapsulated now on i18n_string_textgroup_default class.
  • Note: i18n_string_text table will need a 'format' field, so we can fix too that text format related issues.

from i18n.

herbdool avatar herbdool commented on July 28, 2024

I'll note that Jose didn't end up finishing those steps because he said it was a "major rework of i18n_strings" and he wanted a stable release soon. So it seems possible but not a small job.

Either way it seems that we'd need an upgrade path for textgroups. So perhaps we just bring them back and, if we agree, to do the rework of i18n_string later.

from i18n.

indigoxela avatar indigoxela commented on July 28, 2024

Whoa... refactoring i18n, or just i18n_string, is probably something we won't be able to do. We don't have enough time and people for this. And I don't think that it's worth the effort anyway. Please note that the export by group works, but the import ignores groups.

If I had enough time, I'd rather start fresh and do something way simpler than i18n - which is a complex beast with a terrible UX.

from i18n.

indigoxela avatar indigoxela commented on July 28, 2024

Reverting my workaround for missing textgroups might be a little more work than I hoped:

Above list is probably incomplete.

from i18n.

herbdool avatar herbdool commented on July 28, 2024

Your workarounds were to support textgroups in i18n instead of in core? I guess that's a possibility too. Just didn't seem easy since there were a number of function signature changes. What do you think @indigoxela ? Do you prefer putting it back in core or keep workarounds here?

from i18n.

indigoxela avatar indigoxela commented on July 28, 2024

Do you prefer putting it back in core or keep workarounds here?

I wish I could tell... 😉

from i18n.

indigoxela avatar indigoxela commented on July 28, 2024

I wish I could tell

I made up my mind: handle it in i18n. Waiting for core makes things even more difficult.

There will have to be some cleanup in the import form. - That's the only remaining task here.

from i18n.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.