In our project we have implemented abp language module
We currently have an API to update existing language texts (/api/language-management/language-texts/{resourceName}/{cultureName}/{name}),
but there is no API available to create new language texts. can you please let me know how can we create new Language text from UI using the api.
6 Answer(s)
-
0
- In the ABP Language Management (Pro) module, language texts are not created as brand-new keys via a “create” API. The module is designed to manage/override translations for existing localization keys that come from:
- localization resources registered in
AbpLocalizationOptions, or - an external localization store.
- localization resources registered in
- That’s why you only see endpoints like update (
PUT /api/language-management/language-texts/{resourceName}/{cultureName}/{name}): it updates/overrides the value of an existing key. If the key doesn’t exist in the resource, the UI/API won’t treat it as something to create.
What you can do from UI
- Add the key to your localization resource first (e.g., in your
en.jsonunder the relevant resource name, or whichever base resource you use). - Then use the existing Language Texts UI/API to set translations / override values for target cultures (including setting a value for the base culture if needed).
If you truly need “create new key from UI”
- You must implement your own feature/endpoints (custom AppService + UI) that writes keys to your chosen localization storage (e.g., your own DB table), and then plug it into ABP localization as a contributor/store. The built-in Language Management module UI won’t create new keys by itself.
Links (validated):
- https://abp.io/docs/latest/modules/language-management
- https://abp.io/docs/10.6/modules/language-management
This response was generated by AI. If it didn’t solve your problem, feel free to post a new answer — our support team will jump in to help you soon.
Markdown supported.Copy, paste, or drag & drop images and files (max 100 MB per file, 100 MB total per post) - In the ABP Language Management (Pro) module, language texts are not created as brand-new keys via a “create” API. The module is designed to manage/override translations for existing localization keys that come from:
-
0
Hi,
There is no separate create endpoint. To create a new key under an existing localization resource, call the same update endpoint with a non-empty value:
PUT /api/language-management/language-texts/{resourceName}/{cultureName}/{name}?value=Your%20TextOn a raw HTTP request
valueis a query-string parameter; with a generated Angular or C# proxy it's just the last argument ofupdate/UpdateAsync. An empty value won't create a brand-new key.The caller needs
LanguageManagement.LanguageTextsand itsLanguageManagement.LanguageTexts.Editchild permission, and theLanguageManagement.Enablefeature has to be on.A few things to watch out for:
resourceNamehas to be an already registered localization resource. The endpoint creates new keys, not new resources.- These texts are tenant scoped. A text created on the host side isn't inherited by tenants, so either add the key to your application's localization files for a shared default, or create it once per tenant.
- The Language Texts list uses the selected base culture as its source of keys, so add the key to the base culture first. A key that only exists in a target culture won't show up there.
- Reload an already open page after the call so it picks up the new localization data.
Thanks
Markdown supported.Copy, paste, or drag & drop images and files (max 100 MB per file, 100 MB total per post) -
0
I'm encountering an issue when calling the Language Text Update API: PUT /api/language-management/language-texts/{resourceName}/{cultureName}/{name} The request fails with a 500 Internal Server Error, and the browser reports it as a CORS issue. Request URL: https://localhost:44371/api/language-management/language-texts/AbpAccount/de-DE/AccessDenied?value=Zugriff+abgelehnt! Browser Error: Access to XMLHttpRequest at 'https://localhost:44371/api/language-management/language-texts/AbpAccount/de-DE/AccessDenied?value=Zugriff+abgelehnt!' from origin 'http://localhost:44347' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource. Failed to load resource: net::ERR_FAILED
Markdown supported.Copy, paste, or drag & drop images and files (max 100 MB per file, 100 MB total per post) -
0
Hi,
The browser error is a CORS failure on
http://localhost:44347. As long as that's in the way, your code never sees the actual response of the call.Make sure that origin is in
App:CorsOriginsof the API host onhttps://localhost:44371(append it, don't replace what's already there), then restart that host:"App": { "CorsOrigins": "https://*.MyProjectName.com,http://localhost:44347" }For localhost the scheme and the port have to match exactly, so
http://localhost:44347andhttps://localhost:44347count as two different origins.For the 500, call the same endpoint outside the browser: from the Swagger UI of the API host after clicking
Authorize, or from Postman with the same access token.AbpAccount/de-DE/AccessDeniedworks on a standard application, so if it still fails there, send us the full exception and stack trace from the API host log along with your ABP version. This one explains how to get the logs if you need it: https://abp.io/support/questions/8622/How-to-enable-Debug-logs-for-troubleshoot-problemsThanks
Markdown supported.Copy, paste, or drag & drop images and files (max 100 MB per file, 100 MB total per post) -
0
I have checked this with swagger i am giving you detail here
Request from swagger https://localhost:44371/api/language-management/language-texts/BookMaster/hi/BookMaster%3A%3ABookPrices?value=%E0%A4%95%E0%A4%BF%E0%A4%A4%E0%A4%BE%E0%A4%AC%20%E0%A4%95%E0%A5%80%20%E0%A4%95%E0%A5%80%E0%A4%AE%E0%A4%A4
Response -- Microsoft.AspNetCore.Routing.Matching.AmbiguousMatchException: The request matched multiple endpoints. Matches:
Volo.Abp.LanguageManagement.LanguageTextController.UpdateAsync (Volo.Abp.LanguageManagement.HttpApi) Elephant.LanguageTexts.LanguageTextController.UpdateAsync (Elephant) at Microsoft.AspNetCore.Routing.Matching.DefaultEndpointSelector.ReportAmbiguity(Span
1 candidateState) at Microsoft.AspNetCore.Routing.Matching.DefaultEndpointSelector.ProcessFinalCandidates(HttpContext httpContext, Span1 candidateState) at Microsoft.AspNetCore.Routing.Matching.DefaultEndpointSelector.Select(HttpContext httpContext, Span`1 candidateState) at Microsoft.AspNetCore.Routing.Matching.DfaMatcher.MatchAsync(HttpContext httpContext) at Microsoft.AspNetCore.Routing.EndpointRoutingMiddleware.Invoke(HttpContext httpContext) at Volo.Abp.AspNetCore.Tracing.AbpCorrelationIdMiddleware.InvokeAsync(HttpContext context, RequestDelegate next) at Microsoft.AspNetCore.Builder.UseMiddlewareExtensions.InterfaceMiddlewareBinder.<>c__DisplayClass2_0.<HEADERS
Accept: / Accept-Encoding: gzip, deflate, br, zstd Accept-Language: en-US,en;q=0.9 Connection: close Content-Length: 0 Cookie: .AspNetCore.Mvc.CookieTempDataProvider=CfDJ8KJd1SFUIWtGszVVfvyHcAM86aAOknmSyS75ugsbS-OQHOHaLTQ-D7Wu2XidOzWKtDjUFBnDwGiGFKKtFXbf6HRbK4D-oeBgGTCjN3Zhv0V-hVYFb5vQd5yr6EvKOlWj4cGV_u7fBvpwQTs9UH_uXqOG0gmoxndoENqSftaC8mz; .AspNetCore.Antiforgery.1I8H_rb8Gbk=CfDJ8KJd1SFUIWtGszVVfvyHcAOq8QX2r7zgWtfILABprWQghfDl0kzmAxVIMbjzoDKEIQPtFFz180D5GL2Q6gVqVHkb4lJi_1kXsnN_Z5U0tmEDhdfc3HrQK4JCzWV5lxFGk0ph4dDrjX60EwSSaWY0QZQ; .AspNetCore.Identity.Application=CfDJ8K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1EsToSuuuU63QYCbwH66o9xPy-iFWkVkYKnd-bDEA9jZ6tEEpAjI36kaAw21clumhO1JAGwguRkv5VEHokS7ua3g Host: localhost:44371 Referer: https://localhost:44371/swagger/index.html User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/150.0.0.0 Safari/537.36 Edg/150.0.0.0 requestverificationtoken: CfDJ8KJd1SFUIWtGszVVfvyHcAMHXZo8P6c3EkUEGL8L-x5Ak1-eW-35Nkyvh64cM06uhk-pt7V27ss5h0ZJQ5OAQ-oXWxNRASebHtNVsGQ3--1EsToSuuuU63QYCbwH66o9xPy-iFWkVkYKnd-bDEA9jZ6tEEpAjI36kaAw21clumhO1JAGwguRkv5VEHokS7ua3g sec-ch-ua-platform: "Windows" x-requested-with: XMLHttpRequest sec-ch-ua: "Not;A=Brand";v="8", "Chromium";v="150", "Microsoft Edge";v="150" sec-ch-ua-mobile: ?0 origin: https://localhost:44371 sec-fetch-site: same-origin sec-fetch-mode: cors sec-fetch-dest: empty priority: u=1, i X-Correlation-Id: 00ff3e7f9deb4abaaf22519e667e3a1c
Markdown supported.Copy, paste, or drag & drop images and files (max 100 MB per file, 100 MB total per post) -
0
Hi,
Your
Elephant.LanguageTexts.LanguageTextControlleruses the same route as the Language Management one, and that's what theAmbiguousMatchExceptionis about. Drop the conflictingUpdateAsyncfrom your controller and call the module endpoint.The URL needs one fix too. The API takes the resource name and the key in separate route segments, so the key is
BookPriceson its own.BookMaster::BookPricesis the combined form, and passing it as the key stores a text under that literal name that nothing looks up:PUT /api/language-management/language-texts/BookMaster/hi/BookPrices?value=<url encoded text>With a non-empty value that creates the text if it isn't there yet.
Swagger calls the API from the same origin, so that response wasn't a CORS problem. Keep the
App:CorsOriginsentry for the case where your UI runs on a different origin than the API.Thanks
Markdown supported.Copy, paste, or drag & drop images and files (max 100 MB per file, 100 MB total per post)