markdown 在CodeIgniter中开发多语言站点

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了markdown 在CodeIgniter中开发多语言站点相关的知识,希望对你有一定的参考价值。

## Specify Default Language and Language Options

Go to application/config folder and open config.php. Add the following line to specify the website’s default language.

```
$config['language']  = 'english';
```
```
$config['language']  = 'english';
```

Now to create the language options, of to application/language folder and create separate subfolders for each language. Next, in each subfolder, create a file with the suffix _lang. For instance, if you wish to offer a file named information.php in English and German languages, use the following structure:

**Application→ language → English → information_lang.php**

**Application→ language → German → information_lang.php**

## Set up Language Files

Within the language file, information_lang.php, add every line of text to a $lang array in the following format:

```
$lang['language_key'] = 'type your message';
```

```
$lang['language_key'] = 'type your message';
```

For instance, the entry for the text line, “Type message in German” in the file in the German language folder would look like:

```
$lang['welcome_message'] = 'Type message in German';
```

```
$lang['welcome_message'] = 'Type message in German';
```

Read full article at: https://www.cloudways.com/blog/multi-language-codeigniter/

以上是关于markdown 在CodeIgniter中开发多语言站点的主要内容,如果未能解决你的问题,请参考以下文章

codeigniter 怎么切换数据库

在 Codeigniter 中获取多字段表单时遇到问题

在codeigniter中制作多站点和多语言网站的正确方法

Codeigniter 多文件上传

使用 PHP/CodeIgniter 从具有多对多关系的两个表中显示数据

codeigniter 4 多文件验证