Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8385171
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T17:36:10+00:00 2026-06-09T17:36:10+00:00

I want to set the default application language as my visitor countries language. I

  • 0

I want to set the default application language as my visitor countries language. I have an API to get the IP prefix idiom and based in this information, I want to set the language.

What is the best way to do this? I want to make a cookie to store the language identifier, but where do I have to set this?

Thanks.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-09T17:36:11+00:00Added an answer on June 9, 2026 at 5:36 pm

    Have you seen CodeIgniter’s Language library?

    The Language Class provides functions to retrieve language files and lines of text for purposes of internationalization.

    In your CodeIgniter system folder you’ll find one called language containing sets of language files. You can create your own language files as needed in order to display error and other messages in other languages.

    Language files are typically stored in your system/language directory. Alternately you can create a folder called language inside your application folder and store them there. CodeIgniter will look first in your application/language directory. If the directory does not exist or the specified language is not located there CI will instead look in your global system/language folder.

    In your case…

    • you need to create a polish_lang.php and english_lang.php inside application/language/polish
    • then create your keys inside that file (e.g. $lang['hello'] = "Witaj";
    • then load it in your controller like $this->lang->load('polish_lang', 'polish');
    • then fetch the line like $this->lang->line('hello'); Just store the return value of this function in a variable so you can use it in your view.

    Repeat the steps for the english language and all other languages you need.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

in my site i want to set default page to open, using this script
I want to set my GtkComboBox to have some default value/name, on it as
I have Firefox set as my default browser, but I want to debug the
Hii People, i want to set up a default exception handler for all application
I have created a Cocoa document based picture drawing application. I want that the
I have an Android application which I wrote for english language now I want
I have a user define class inside my zend application(as default) application/library/Custom_/Custom_Test.php I want
I want to set my default Domain name for my site to be given
i want to set the default value in a sql server 2005 datetime field
If I create a class that extends UserControl and want to set a default

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.