Open Closed

Localization in razor page #8773


User avatar
0
nabass created

hi i want to make a logic within razor page if i open with language (en) so do something else if (ar) do another thing so i used @using System.Globalization @{ var currentCulture = CultureInfo.CurrentUICulture.Name; var isArabic = currentCulture.StartsWith("ar"); } <div class="completion-message text-center" style="display: none;"> <div class="modal d-block mx-auto" tabindex="-1" style="background:#cccccc96;"> <div class="modal-dialog modal-xl"> <div class="modal-content w-75"> <div class="modal-body"> @if (isArabic) { <h1>مبرووووووووووووك</h1> } else { <img src="/images/Wizard/congrat.png" alt="congratulation, finished the setup" class="w-100" /> } </div> <div class="modal-footer"> <button class="btn btn-primary" id="congrats">Ok</button> </div> </div> </div> </div> </div>

but not work ... so how to know which culture user open with i mean this how to know which language user select ??

  • ABP Framework version: v8.0.2
  • UI Type: MVC
Markdown supported.
Copy, paste, or drag & drop images and files (max 100 MB per file, 100 MB total per post)

1 Answer(s)
  • User Avatar
    0
    nabass created

    thanks i solved it using [BindProperty] public string currentCulture { get; set; } public async Task<IActionResult> OnGetAsync() { currentCulture = CultureInfo.CurrentUICulture.EnglishName; }

    Markdown supported.
    Copy, paste, or drag & drop images and files (max 100 MB per file, 100 MB total per post)
Boost Your Development
ABP Live Training
Packages
See Trainings
Mastering ABP Framework Book
The Official Guide
Mastering
ABP Framework
Learn More
Mastering ABP Framework Book
Made with ❤️ on ABP v10.8.0-preview. Updated on September 28, 2026, 11:44
1
ABP Assistant
🔐 You need to be logged in to use the chatbot. Please log in first.