Replies: 6 comments 1 reply
-
Two more things worth noting: There is nothing stopping non-official modules from doing the same thing. Anyone could create a module that improves The other thing is that the more we use the same namespace the more we have to be careful about creating conflicts. If the core team creates 20-30 modules over time that could become a lot to watch out for. We would probably end up doing some kind of module-level unofficial namespacing, such as |
Beta Was this translation helpful? Give feedback.
-
To clarify the technical points: Modules that ship phrases, even as part of the So there is nothing preventing Given that we can do it either way though, there's still a lotta ins, a lotta outs...
So here's what I would recommend:
|
Beta Was this translation helpful? Give feedback.
-
I would say separate namespaces because of conflicts mainly, yes. The same key can mean two things to two developers. A gray area is the intentional reuse of existing |
Beta Was this translation helpful? Give feedback.
-
(I do think some minor "bc breaks" to localization phrases are going to happen occasionally and we probably can't be as strict about this as we are about, say, changing a documented method's first argument.) |
Beta Was this translation helpful? Give feedback.
-
I think we've landed on a plan to namespace individually installed modules with unique strings. So only Apostrophe core uses
|
Beta Was this translation helpful? Give feedback.
-
Looks good to me!
…On Thu, Sep 30, 2021 at 11:46 AM Alex Bea ***@***.***> wrote:
I think we've landed on a plan to namespace individually installed modules
with unique strings. So only Apostrophe core uses apostrophe:. Redirect
would use aposRedirect (going with camel case) and SEO aposSeo. When we
get to porting something like apostrophe-security-headers, we should
probably start abbreviating to aposSecHead or something like that.
- All of this only applies to official modules.
- Any community modules should use their own unique and usable
namespaces (or a best effort to be unique) to avoid conflicts.
- Using an apos namespace likely can't be prevented, but is highly
discouraged. They are all in Apostrophe projects, so there is no general
value in using that prefix.
- Project code should not need to namespace locale strings at all. If
a project does need namespacing for locale strings then they should
probably aim to be unique as well (e.g., a short version of the
organization name).
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#3454 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAAH27MUKHNPJTJUGZC2DQTUESA5BANCNFSM5E5UH3XA>
.
Triage notifications on the go with GitHub Mobile for iOS
<https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675>
or Android
<https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub>.
--
THOMAS BOUTELL | CHIEF TECHNOLOGY OFFICER
APOSTROPHECMS | apostrophecms.com | he/him/his
|
Beta Was this translation helpful? Give feedback.
-
Apostrophe 3 core has the localization strings namespaced with
apostrophe:
. This allows other modules to use localization strings with the same keys without conflicts. Read more: https://v3.docs.apostrophecms.org/guide/localization/static.html#using-namespacesThe question: Should we use that same namespace for all official Apostrophe modules (those created and supported by the core maintainers)? Or do we need unique namespaces for each module (e.g.,
apos-form:
for the form module).If we do use the same namespace each module would need to be a bundle that includes a sub-module that improves
@apostrophecms/i18n
. That makes sense for the form module, for example, which is already a bundle. If the module was something like Apostrophe Redirect, which isn't a bundle, that is a bit of a different story. That said, it's not a lot of complication to add that bundled module in, and the value of a single namespace seems high to me.My recommendation would be that we do use a single namespace for official module localization strings for the sake of consistency and simplicity in naming. Thoughts?
Beta Was this translation helpful? Give feedback.
All reactions