-
Notifications
You must be signed in to change notification settings - Fork 45
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
Introduce Glossary Messages #62
Comments
Can you clarify what problem this would solve? I'm wondering if I'm missing a good technical reason to support this. What would happen if the code calls directly |
There are two big reasons:
|
The bit here that is interesting to me is private messages, which we have only in the sense of obsolete messages right now. I wonder if syntax is the right abstraction level for this. Wouldn't this make implementing parsers quite a bit harder? Also, what'd be the value of a private message? I'm not a big fan of going back from tags to key-value pairs, I think I like the concept of not having to name things twice by now. |
Yes :) The first draft of this issue used For tools like
We already have an artifact of this thinking in the syntax: Line 44 in 3c0e901
I'm still thinking about this. I like it too but I also see a lot of value in having one type of data fewer. I'll file another issue about this and let's keep this one about private / glossary messages. |
Need to think about it a bit more, but several thoughts after reading it twice:
|
We already allow dashes inside of identifiers which has the same problem. I really doubt we'll ever need to subtract two ids. If we do, there are always s-expressions :)
This distinction would only be made by tools. For Fluent, The double dash is the proposed convention for tools to differentiate between messages that should be present in the localization if the reference has them ( -brand-name = Firefox
app-title = { -brand-name } A tool like |
Fix projectfluent#62. Private messages are similar to regular messages but they can only be used as references in other messages. The runtime cannot retrieve them directly. They are best used to define glossary terms which can be used consistently across the localization of the entire product. Private messages can store some grammatical information about themselves in tags. Private messages are not allowed to have attributes.
Fix projectfluent#62. Private messages are similar to regular messages but they can only be used as references in other messages. Their identifiers start with at least one dash `-`, e.g. `-brand-name`. The runtime cannot retrieve private messages directly. They are best used to define glossary terms which can be used consistently across the localization of the entire product. Private messages can store some grammatical information about themselves in tags. Private messages are not allowed to have attributes.
Fix projectfluent#62. Private messages are similar to regular messages but they can only be used as references in other messages. Their identifiers start with at least one dash `-`, e.g. `-brand-name`. The runtime cannot retrieve private messages directly. They are best used to define glossary terms which can be used consistently across the localization of the entire product. Private messages can store some grammatical information about themselves in tags. Private messages are not allowed to have attributes.
Fix projectfluent#62. Private messages are similar to regular messages but they can only be used as references in other messages. Their identifiers start with at least one dash `-`, e.g. `-brand-name`. The runtime cannot retrieve private messages directly. They are best used to define glossary terms which can be used consistently across the localization of the entire product. Private messages can store some grammatical information about themselves in tags. Private messages are not allowed to have attributes.
Fix projectfluent#62. Private messages are similar to regular messages but they can only be used as references in other messages. Their identifiers start with at least one dash `-`, e.g. `-brand-name`. The runtime cannot retrieve private messages directly. They are best used to define glossary terms which can be used consistently across the localization of the entire product. Private messages can store some grammatical information about themselves in tags. Private messages are not allowed to have attributes.
Fix projectfluent#62. Private messages are similar to regular messages but they can only be used as references in other messages. Their identifiers start with at least one dash `-`, e.g. `-brand-name`. The runtime cannot retrieve private messages directly. They are best used to define glossary terms which can be used consistently across the localization of the entire product. Private messages can store some grammatical information about themselves in tags. Private messages are not allowed to have attributes.
Before we discuss the implementation in #68, I'd like to get sign-offs on this proposal from the majority of the core team. Please comment in this thread and tick the box next to your name if you give this proposal a green light. |
r+ |
1 similar comment
r+ |
Fix projectfluent#62. Private messages are similar to regular messages but they can only be used as references in other messages. Their identifiers start with at least one dash `-`, e.g. `-brand-name`. The runtime cannot retrieve private messages directly. They are best used to define glossary terms which can be used consistently across the localization of the entire product. Private messages can store some grammatical information about themselves in tags. Private messages are not allowed to have attributes.
Fix projectfluent#62. Private messages are similar to regular messages but they can only be used as references in other messages. Their identifiers start with at least one dash `-`, e.g. `-brand-name`. The runtime cannot retrieve private messages directly. They are best used to define glossary terms which can be used consistently across the localization of the entire product. Private messages can store some grammatical information about themselves in tags. Private messages are not allowed to have attributes.
Goal
Recognize the glossary translations type which cannot be retrieved by the calling code.
Summary
The proposed syntax for glossary messages is via an identifier starting with
-
(a dash):Glossary messages cannot be retrieved from the
MessageContext
they're defined in and they can only be referenced in other messages. Glossary messages and public messages are separate AST nodes extending themessage
node in the ASDL spec.Description
Glossary translations are not intended to be used directly by the calling code. Instead they should go through another, public, message. The current syntax already hints at this by disallowing tags and attributes to be defined on the same message. The introduction of glossary messages will make this design explicit.
This change boils down to allowing
-
as the first character of the identifier. Its consequences are, however, far-reaching. Tools likecompare-locales
should not inspect attributes of glossary messages. These attributes are consequently private and cannot be used for translating widget attributes (like in HTML). They may be used for language-specific information and they could replace tags.Example
English:
Polish (with glossary attributes replacing tags):
Private Messages
By allowing
-
as the first character of the identifier we will also enable ids of the form--foo
. These could be used by tools to differentiate between glossary messages which must be present in an FTL file and private messages which are localizer-defined.I would still encourage everyone to spell the whole sentence out:
open-tab = Open a new tab
Signoffs
The text was updated successfully, but these errors were encountered: