Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix build windows #8

Merged
merged 2 commits into from
May 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ project(cpp-i18n LANGUAGES CXX)
set(CMAKE_CXX_STANDARD 20)

if (NOT WIN32)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra -fdiagnostics-color=always")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -fdiagnostics-color=always")
endif()

# Build library
Expand All @@ -14,7 +14,7 @@ add_subdirectory(src)
# Fetch dependencies
include(FetchContent)

FetchContent_Declare(json URL https://github.com/nlohmann/json/releases/download/v3.11.2/json.tar.xz)
FetchContent_Declare(json URL https://github.com/nlohmann/json/releases/download/v3.11.3/json.tar.xz)
FetchContent_MakeAvailable(json)

target_link_libraries(cpp-i18n PRIVATE nlohmann_json::nlohmann_json)
Expand Down
39 changes: 23 additions & 16 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,17 @@

## Introduction

cpp-i18n is a C++ library for internationalization (i18n) of C++ applications, which was made to be as simple as
cpp-i18n is a C++ library for internationalization (i18n) of C++ applications, which was made to be as simple as
possible to use, with easy integration into existing projects.

- [Installation](#installation)
- [CMake](#cmake)
- [CMake](#cmake)
- [Usage](#usage)
- [Basic usage](#basic-usage)
- [Multiple languages](#multiple-languages)
- [Multiple files](#multiple-files)
- [Custom locales directory path](#custom-locales-directory-path)
- [Parameters in localized strings](#parameters-in-localized-strings)
- [Basic usage](#basic-usage)
- [Multiple languages](#multiple-languages)
- [Multiple files](#multiple-files)
- [Custom locales directory path](#custom-locales-directory-path)
- [Parameters in localized strings](#parameters-in-localized-strings)
- [Planned features](#planned-features)

## Installation
Expand All @@ -27,7 +27,7 @@ include(FetchContent)
FetchContent_Declare(
cpp-i18n
GIT_REPOSITORY https://github.com/Sinan-Karakaya/cpp-i18n.git
GIT_TAG v0.1.0
GIT_TAG v0.2.2
)

FetchContent_MakeAvailable(cpp-i18n)
Expand All @@ -44,9 +44,10 @@ target_link_libraries(
### Basic usage

assets/locales/en/basic.json

```json
{
"hello": "Hello, world!"
"hello": "Hello, world!"
}
```

Expand All @@ -67,16 +68,18 @@ int main()
### Multiple languages

assets/locales/en/basic.json

```json
{
"hello": "Hello, world!"
"hello": "Hello, world!"
}
```

assets/locales/fr/basic.json

```json
{
"hello": "Bonjour, monde!"
"hello": "Bonjour, monde!"
}
```

Expand All @@ -99,16 +102,18 @@ int main()
### Multiple files

assets/locales/en/basic.json

```json
{
"hello": "Hello, world!"
"hello": "Hello, world!"
}
```

assets/locales/en/other.json

```json
{
"goodbye": "Goodbye, world!"
"goodbye": "Goodbye, world!"
}
```

Expand All @@ -128,9 +133,10 @@ int main()
### Custom locales directory path

path/to/locales/en/basic.json

```json
{
"hello": "Hello, world!"
"hello": "Hello, world!"
}
```

Expand All @@ -151,9 +157,10 @@ int main()
### Parameters in localized strings

assets/locales/en/parameters.json

```json
{
"hello": "Hello, my name is {{ name }}!"
"hello": "Hello, my name is {{ name }}!"
}
```

Expand All @@ -177,4 +184,4 @@ The format `{{ paramName }}` is space sensitive, so `{{paramName}}` will not wor
- [ ] Support for pluralization [(#2)](https://github.com/Sinan-Karakaya/cpp-i18n/issues/2)
- [ ] Support for localization of numbers, dates, currencies, etc... [(#4)](https://github.com/Sinan-Karakaya/cpp-i18n/issues/4)
- [ ] Support for automatically detecting multiple locales [(#3)](https://github.com/Sinan-Karakaya/cpp-i18n/issues/3)
- [X] Support for parameters in localized strings
- [x] Support for parameters in localized strings
Loading