Replies: 1 comment
-
I'm not sure that this approach would necessarily provide a solution to the challenges that are presented in the "background" section. Specifically, an issue arises from the definition of the registry. If I were to take the entire corpus of messages available in the current scope, and declare those to be the first-party registry of referenceables, the system as a whole becomes exactly analogous to a system where references to other messages are directly allowed. In other words, I at least find referenceables and messages to be far too similar for conversion from one to the other to be difficult; this to me suggests that in the data model, they ought to be the same thing. As an alternative, I would suggest that with a data model that defines each message as belonging to an identifiable set of messages, a "resource", it becomes easy to define a linter rule that would limit all message references to only use messages in a subset of those resources that the user or organisation considers as their first-party registry. |
Beta Was this translation helpful? Give feedback.
-
I wrote a draft of this a few weeks ago but I didn't have the time to fully flesh it out. I decided to open an issue about it to gauge if this idea resonates with more people.
Background
I recognize and acknowledge the usefulness and pragmatism of message references. The do pose some challenges, however:
Proposal
For mitigate the above risks, I'd like to propose a set of restrictions which will make message references safer to use, but hopefully still useful.
Messages vs. Referenceables
I'd like to make a distinction between (a) messages which can be retrieved by the application code and (b) messages which can be referenced from other messages. For the lack of a better word, I'll call the second type of messages referenceables.
Two levels of definitions
Referenceables can be defined in:
Crucially, translators can only create new referenceables inside existing messages. Thanks to this, every message is completely resolvable as long as the registry is available. It can be edited, moved and deleted in isolation without having any knowledge of other messages and without impacting them either.
Data Model
Referenceables are a concept in the data model. CAT UIs and the syntax (which is a kind of UI, come to think about it) can choose to represent them as either a flat list of consecutive units:
Or even as a Fluent-like nested construct like the one below:
shared-photos = {$userName} {$photoCount -> [one] added a new photo *[other] added {$photoCount} new photos } to {$userGender -> [male] his album [female] her album *[other] their album }.
Beta Was this translation helpful? Give feedback.
All reactions