Skip to content
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

Make the names of the { key label } types overridable / globally-overridable #5

Open
gmiserez opened this issue Oct 21, 2022 · 0 comments
Labels
enhancement New feature or request Translations This concerns the Translations Package

Comments

@gmiserez
Copy link
Collaborator

gmiserez commented Oct 21, 2022

Currently, the generated resource types are always named TranslatedResourceOf{NameOfOriginalType}.
It should be possible to override the default naming.

services
   .AddRouting()
  .AddGraphQLServer()
  .AddTranslation(c => c
        .AddTranslatableType<HairColor>()
        ...
        .SetNamingConvention("Translated{Name}") // ...or something like that
   )

Additionally it could be interesting to be able to override these names on each field:

    public class Human
    {
        [Translate<MaritalStatus>(resourceKeyPrefix: "MaritalStatus", typeName: "TranslatedMaritalStatus")]
        public MaritalStatus MaritalStatus { get; }
    }
@gmiserez gmiserez added enhancement New feature or request Translations This concerns the Translations Package labels Oct 21, 2022
@gmiserez gmiserez changed the title Make the name of the { key label } types overridable / globally-overridable Make the names of the { key label } types overridable / globally-overridable Oct 21, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request Translations This concerns the Translations Package
Projects
None yet
Development

No branches or pull requests

1 participant