Skip to content

Projectconfiguratie

Gitlab token vereisten

Om de Gitlab API te kunnen gebruiken, moet je een project toegangstoken aanmaken. Deze token moet de volgende rechten hebben:

  • api: Toegang tot de API
  • read_api: Toegang tot het lezen van de API
  • read_repository: Toegang tot de repository
  • write_repository: Toegang tot het schrijven naar de repository

Met als rol Maintainer.

Regex configuratie

Bij de configuratie van het project hoort ook het instellen van de regex voor de vertalingsbestanden. Deze regex wordt gebruikt om de naam die getoond moet worden aan de gebruiker op te halen, de taalcode en het basePath.

Vereiste groepen:

  • (?<basePath>.*): het pad dat voor alle vertalingen in de groep gebruikt wordt
    • .* staat voor elk teken, dus het basePath kan elk willekeurig pad zijn.
  • (?<namespace>[a-zA-Z-]*): de naam die getoond moet worden aan de gebruiker
    • [a-zA-Z-]* staat voor een optionele namespace, die alleen letters en koppeltekens bevat. Dit is handig voor het categoriseren van vertalingen

Optionele groepen:

  • (?<language>[a-zA-Z]{2,4}(-[a-zA-Z]{2,4})?): de taalcode van de taal waarin de vertalingen staan
    • [a-zA-Z]{2,4} staat voor een taalcode van 2 tot 4 letters, zoals en, nl, fr, etc.
    • (-[a-zA-Z]{2,4})? staat voor een optionele landcode, zoals en-US, nl-BE, etc.

Optionele groepen

Optionele groepen kunnen weggelaten worden, maar sommige bestanden zoals JSON vereisen deze groepen wel. Bij bestanden zoals ResX is deze niet verplicht aangezien deze een fallback bestand heeft waar geen taalcode in staat.

Template projecten

Sql injectie script

SET @projectId = '<projectId>';
SET SESSION sql_mode = 'NO_BACKSLASH_ESCAPES';
INSERT INTO ProjectRegex (Id, ProjectId, RegexPattern, Name, Created, Changed)
VALUES (
           uuid(),
           @projectId,
           # Vervang template\.bluenotion\.nl met de juiste front-end folder
           '(?<basePath>^template\.bluenotion\.nl.*?)(?<language>/[a-zA-Z]{2,4}(-[a-zA-Z]{2,4})?)\/(?<namespace>[a-zA-Z-]*).json$',
           'Applicatie',
           NOW(),
           NOW()
       ),
       (
           uuid(),
           @projectId,
           '(?<basePath>Resources\/.*?)(?<namespace>[a-zA-Z-]*).(?<language>[a-zA-Z]{2,4}(-[a-zA-Z]{2,4})?).json$',
           'Server',
           NOW(),
           NOW()
       ),
       (
           uuid(),
           @projectId,
           '(?<basePath>.*?)\/(?<namespace>[a-zA-Z]*)\.(?<language>[a-zA-Z]{2,4}(-[a-zA-Z]{2,4})?)\.scriban$',
           'Emails',
           NOW(),
           NOW()
       ),
       (
           uuid(),
           @projectId,
           # Vervang app\.bluenotion\.nl met de juiste app folder
           '(?<basePath>app\.bluenotion\.nl/src/i18n.*?)(?<language>/[a-zA-Z]{2,4}(-[a-zA-Z]{2,4})?)\/(?<namespace>[a-zA-Z-]*).json$',
           'App',
           NOW(),
           NOW()
       );

SET SESSION sql_mode = '';

Applicatie

(?<basePath>^template\.bluenotion\.nl.*?)(?<language>/[a-zA-Z]{2,4}(-[a-zA-Z]{2,4})?)\/(?<namespace>[a-zA-Z-]*).json$

Pad BasePath Namespace Taalcode Match
template.bluenotion.nl/src/i18n/nl/adminCustomerTabs.json template.bluenotion.nl/src/i18n/nl adminCustomerTabs nl
template.bluenotion.nl/src/i18n/nl/forgot-password.json template.bluenotion.nl/src/i18n/nl forgot-password nl

Server

(?<basePath>Resources\/.*?)(?<namespace>[a-zA-Z-]*).(?<language>[a-zA-Z]{2,4}(-[a-zA-Z]{2,4})?).json$

Pad BasePath Namespace Taalcode Match
Api.Bluenotion.Nl/Resources/Services/AccountService.en.json Api.Bluenotion.Nl/Resources/Services AccountService en
Api.Bluenotion.Nl/Resources/Filters/CustomExceptionFilter.de.json Api.Bluenotion.Nl/Resources/Filters CustomExceptionFilter de

Emails

(?<basePath>.*?)\/(?<namespace>[a-zA-Z]*)\.(?<language>[a-zA-Z]{2,4}(-[a-zA-Z]{2,4})?)\.scriban$

Pad BasePath Namespace Taalcode Match
Api.Bluenotion.Nl/MessageTemplates/adminInvitation.nl.scriban Api.Bluenotion.Nl/MessageTemplates adminInvitation nl
Api.Bluenotion.Nl/MessageTemplates/mailLayout.scriban - - -

App

(?<basePath>app\.bluenotion\.nl/src/i18n.*?)(?<language>/[a-zA-Z]{2,4}(-[a-zA-Z]{2,4})?)\/(?<namespace>[a-zA-Z-]*).json$

Pad BasePath Namespace Taalcode Match
app.bluenotion.nl/src/i18n/nl-NL/common.json app.bluenotion.nl/src/i18n/nl-NL common nl-NL
app.bluenotion.nl/src/i18n/nl-NL/account/forgot-password.json app.bluenotion.nl/src/i18n/nl-NL/account forgot-password nl-NL

BenFit

App

Er zijn hier 2 verschillende regex patronen, omdat sommige namespaces in subfolders staat wat voor een andere namespace zorgt.

(?<basePath>App\.BenFit\.Nl\/src)(?!\/screens).*?(?<namespace>[a-zA-Z-]*)\/(?<language>[a-zA-Z]{2,4}(?:-[a-zA-Z]{2,4})?)\.json$

Pad BasePath Namespace Taalcode Match
App.BenFit.Nl/src/i18n/common/nl.json App.BenFit.Nl/src/i18n/common common nl
App.BenFit.Nl/src/screens/list/Actions/translations/fr.json - - -

(?<basePath>App\.BenFit\.Nl\/src)\/screens.*?\/(?<namespace>[a-zA-Z-]*)\/[a-zA-Z-]*\/(?<language>[a-zA-Z]{2,4}(-[a-zA-Z]{2,4})?)\.json$

Pad BasePath Namespace Taalcode Match
App.BenFit.Nl/src/i18n/common/nl.json - - -
App.BenFit.Nl/src/screens/list/Actions/translations/fr.json App.BenFit.Nl/src/screens/list/Actions/translations Actions fr

Server

(?<basePath>.*?)(?<namespace>[a-zA-Z-]*)\.(?<language>[a-zA-Z]{2,4}(-[a-zA-Z]{2,4})?)\.json$

Pad BasePath Namespace Taalcode Match
api.benfit.nl/Api.BenFit.Nl/Resources/Services/AccountService.cs.json api.benfit.nl/Api.BenFit.Nl/Resources/Services AccountService cs
api.benfit.nl/Api.BenFit.Nl/Resources/Filters/CustomExceptionFilter.de.json api.benfit.nl/Api.BenFit.Nl/Resources/Filters CustomExceptionFilter de
api.benfit.nl/Api.BenFit.Nl/Resources/Attributes/BicValidationAttribute.cs.json api.benfit.nl/Api.BenFit.Nl/Resources/Attributes BicValidationAttribute cs
api.benfit.nl/Api.BenFit.Nl/Resources/Services/AccountService-nl.json - - -

Applicatie

Er zijn hier 2 verschillende regex patronen, omdat sommige namespaces in subfolders staat wat voor een andere namespace zorgt.

(?<basePath>web\.benfit\.nl.*?\/)(?<language>[a-zA-Z]{2,4}(-[a-zA-Z]{2,4})?)\/(?<namespace>[a-zA-Z-]*).json$

Pad BasePath Namespace Taalcode Match
web.benfit.nl/src/i18n/nl/common.json web.benfit.nl/src/i18n common nl
web.benfit.nl/src/i18n/nl/account/forgot-password.json - - -

(?<basePath>web\.benfit\.nl.*?\/i18n\/)(?<language>[a-zA-Z]{2,4}(-[a-zA-Z]{2,4})?)\/(?<namespace>[a-zA-Z-]*\/[a-zA-Z-]*).json$

Pad BasePath Namespace Taalcode Match
web.benfit.nl/src/i18n/nl/common.json - - -
web.benfit.nl/src/i18n/nl/account/forgot-password.json web.benfit.nl/src/i18n account/forgot-password nl