Skip to content
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
14 changes: 7 additions & 7 deletions docs/filter_reference.md
Original file line number Diff line number Diff line change
Expand Up @@ -1312,7 +1312,7 @@ Return the localized translation of the input message with pluralization. The fi

```liquid2
{% assign count = "Earth,Tatooine" | split: "," | size %}
{{ "Hello, World!" | ngetetxt: "Hello, Worlds!", count }}
{{ "Hello, World!" | ngettext: "Hello, Worlds!", count }}
```

```plain title="output"
Expand All @@ -1322,7 +1322,7 @@ Hallo Welten!
Any keyword arguments are used to populate message variables. If `user.name` is `"Sue"` and `count` is `1`:

```liquid2
{{ "Hello, %(you)s" | ngetetxt: "Hello, everyone!", count, you: user.name }}
{{ "Hello, %(you)s" | ngettext: "Hello, everyone!", count, you: user.name }}
```

```plain title="output"
Expand All @@ -1334,16 +1334,16 @@ Hallo Sue!
<!-- md:version 0.1.0 -->
<!-- md:liquid2 -->

````
```
<string> | npgettext: <string>, <string>, <number> [, <identifier>: <object> ... ]
``
```

Return the localized translation of the input message with pluralization and a message context. The first positional argument is the message context string, the second is the plural form of the message, and the third is a number used to determine if the singular or plural message should be used.

```liquid2
{% assign count = "Earth,Tatooine" | split: "," | size %}
{{ "Hello, World!" | ngetetxt: "extra special greeting", "Hello, Worlds!", count }}
````
{{ "Hello, World!" | npgettext: "extra special greeting", "Hello, Worlds!", count }}
```

```plain title="output"
Hallo Welten!
Expand All @@ -1352,7 +1352,7 @@ Hallo Welten!
Any keyword arguments are used to populate message variables. If `user.name` is `"Sue"` and `count` is `1`:

```liquid2
{{ "Hello, %(you)s" | ngetetxt: "extra special greeting", "Hello, everyone!", count, you: user.name }}
{{ "Hello, %(you)s" | npgettext: "extra special greeting", "Hello, everyone!", count, you: user.name }}
```

```plain title="output"
Expand Down
2 changes: 1 addition & 1 deletion docs/tag_reference.md
Original file line number Diff line number Diff line change
Expand Up @@ -593,7 +593,7 @@ Any primitive expression can be tested for truthiness, like `{% if some_variable
| `>=` | Greater than or equal to | `user.age >= 18` |
| `<=` | Less than or equal to | `basket.size <= 0` |
| `and` | Logical and | `x and y` |
| `and` | Logical or | `x or y` |
| `or` | Logical or | `x or y` |
| `not` <!-- md:liquid2 --> | Logical not | `not x` |

### Operator precedence
Expand Down
2 changes: 1 addition & 1 deletion liquid2/undefined.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ def __liquid__(self) -> object:
return None

def poke(self) -> bool:
"""Prod the type, giving it the opertunity to raise an exception."""
"""Prod the type, giving it the opportunity to raise an exception."""
return True


Expand Down
2 changes: 2 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,8 @@ ignore = [
"PLR0915",
"SIM108",
"PT001",
"S704",
"TC006",
]

fixable = ["I"]
Expand Down