Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
alpheustangs authored Jun 30, 2023
1 parent 5da7b6b commit d48cdb3
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
# ComfyPHP Multiple Languages Extension

This is a extension for ComfyPHP framework to enable the function using multiple languages.
This is an extension for ComfyPHP framework to enable the function using multiple languages.

## Default & Recommended Directory Structure

- `src` directory (default) <br/>
Where the source files for editing reside. <br/><br/>
- `langs` directory (default) <br/>
Store all languages related source code. <br/><br/>
Store all the languages related source code. <br/><br/>
- `en` directory (optional) <br/>
English translation folder. <br/><br/>
- `index.json` language file <br/>
Expand All @@ -31,15 +31,15 @@ composer require comfyphp/lang

## Usage

ComfyPHP will search for the all the languages based on the `CONFIG_LANG_PATH` settings in `comfy.lang.config.php`.
ComfyPHP will search for all the languages base on the `CONFIG_LANG_PATH` settings in `comfy.lang.config.php`.

You can add the following line into somewhere and import it into every files later, here we take `src/pages/_init.php` for example:

```php
$lang = new ComfyPHP\Lang();
```

Create separate JSON files for each language you want to support. And Place these files in the languages folder. For example, create the following files:
Create separate JSON files for each language you want to support. And Place these files into the languages folder. For example, create the following files:

```php
// src/langs/en/index.json
Expand Down

0 comments on commit d48cdb3

Please sign in to comment.