AskmethatFR / AspNetCore.Localizer.Json

Json Localizer library for NetCore environments
MIT License
17 stars 5 forks source link

Hierarchical Json and setting culture from request header #5

Open drakoo320 opened 4 months ago

drakoo320 commented 4 months ago

Hi,

  1. it it possible to set culture info by every request from header?
  2. I can have only flat json file with translations or can i have "text": {list...}, "text2": {list...}
AskmethatFR commented 4 months ago

Hi,

  1. You should be able to according to https://learn.microsoft.com/en-us/aspnet/core/fundamentals/localization/select-language-culture?view=aspnetcore-8.0

  2. Today no. Can you provide a more complexe example ?

drakoo320 commented 4 months ago
  1. I don't want to store translations on the database side, only in json files. For example, I have two tables in the database: "task_status", "issue_status" with several options: started, canceled, etc. I would like to keep the translations in one JSON file, but divided per table to maintain order and consistency. For example: { "TaskStatus": { "Started": "Started", "Finished": "Finished" }, "IssueStatus": { "Started": "Started", "Finished": "Finished" } }