XF 2.3 Is it better to create phrases with a unique pre-id or without?

When to pre-id your phrases

  • All the time -its easier to find

    Votes: 1 33.3%
  • Just when it's unique (does not already exist in the core

    Votes: 1 33.3%
  • Never, pre-ids look ugly/dont help

    Votes: 1 33.3%

  • Total voters
    3

tenants

Well-known member
I'm asking this because I'm about to phrase everything for a plugin I will release (probably in a couple of weeks)

So my thoughts are, I could a pre id to everything, that would make the phrases easy to find and translate
tenants_click
tenants_login
tenants_open
tenants_something_else

However, there is an agument no to do this, since it's more uncessary work
For example, I could add a phases
{{ phrase('tenants_descending') }}
but it already exists and may have already been translated:
{{ phrase('descending') }}

So, do people usually just pre_id if it doesn't already exists, or do it for everything, or not at all?
 
When I wrote add-ons I always prefixed phrases with a unique reference for the company/site and add-on, not me the developer, e.g cta_ft_something as opposed to paulb_something .
 
yeah, I guess tenants was an example, it would be something like t_bla_ (but I didnt want to give away what my addon was about just yet)
 

Add on data which requires unique IDs or keys (such as template modifications) must be prefixed in a way that can identify the add on or developer

Phrases require unique keys (=the phrase name) so if you want to release your Add-on here and be compliaent with the resource standards:
Prefix phrases you Add-on adds.

I'd try to use core phrases whenever possible to avoid translators having to translate the same stuaff over and over again as this IMHO just doesn't make sense.
 
I think it's always a good idea for add-on phrases, templates, options, nav entries, etc. to be prefixed.

We do it ourselves with our first party add-ons, although it's not always a prefix.

1745786164078.webp

1745786229266.webp
 



Phrases require unique keys (=the phrase name) so if you want to release your Add-on here and be compliaent with the resource standards:
Prefix phrases you Add-on adds.

I'd try to use core phrases whenever possible to avoid translators having to translate the same stuaff over and over again as this IMHO just doesn't make sense.

I guess thats kind of my my question, if the core phrase exists, dont prefix, but if it doesn't exist, then always prefix?
 
Back
Top Bottom