Skip to content

Commit

Permalink
Merge pull request #32 from AckeeCZ/readme-examples
Browse files Browse the repository at this point in the history
Add plist and plurals examples to README.md
  • Loading branch information
LukasHromadnik authored Jun 24, 2022
2 parents 2ee69df + d299e7e commit 827978c
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 3 deletions.
29 changes: 26 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -139,8 +139,6 @@ This is example structure of the spreadsheet with translations
|---------|-------|------|
| hello | Hello | Ahoj |

ACKLocalization also now supports plist files. Simply prefix the key with plist.NameOfPlist - please note that NameOfPlist is case-sensitive.

#### Example config file for this case would be

This is the example config file:
Expand All @@ -159,18 +157,43 @@ This is the example config file:
}
```

### Plist keys

ACKLocalization supports localizing plist files. Simply prefix the key with `plist.InfoPlist`, where `InfoPlist` is the name of plist you need to localize and ACKLocalization will automatically generate respective `InfoPlist.strings` files. Please note that `InfoPlist` name is case-sensitive.

Example keys:

```
plist.InfoPlist.NSPhotoLibraryAddUsageDescription
plist.InfoPlist.NSUserTrackingUsageDescription
```

`InfoPlist.strings` result:

```
"NSPhotoLibraryAddUsageDescription" = "Your photo library usage message.";
"NSUserTrackingUsageDescription" = "Your tracking permission message.";
```

### Plural keys

To add plurals to the spreadsheet you need to specify the translation key and the plural type in the following convention
To add plurals to the spreadsheet, you need to specify the translation key and the plural type using the following [native convention](https://developer.apple.com/documentation/xcode/localizing-strings-that-contain-plurals):

```
translation.key##{zero}
translation.key##{one}
translation.key##{two}
translation.key##{few}
translation.key##{many}
translation.key##{other}
```

This will be automatically generated into `Localizable.stringsDict` and the key won't be presented in `Localizable.strings`.

Example:

![ackee|ACKLocalization](Resources/plurals-example.png)

## Author

[Ackee](https://ackee.cz) team
Expand Down
Binary file added Resources/plurals-example.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 827978c

Please sign in to comment.