Skip to content

Commit

Permalink
update readme and jsdoc
Browse files Browse the repository at this point in the history
  • Loading branch information
timofei-iatsenko committed Jun 27, 2024
1 parent b462451 commit 435bcc3
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 6 deletions.
1 change: 0 additions & 1 deletion packages/babel-plugin-extract-messages/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ import {
isObjectExpression,
} from "@babel/types"
import type { PluginObj, PluginPass, NodePath } from "@babel/core"
import {} from "@babel/core"
import type { Hub } from "@babel/traverse"

type BabelTypes = typeof BabelTypesNamespace
Expand Down
32 changes: 28 additions & 4 deletions packages/format-po/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ export default {

Possible options:

```ts
````ts
export type PoFormatterOptions = {
/**
* Print places where message is used
Expand All @@ -54,14 +54,14 @@ export type PoFormatterOptions = {
* @default true
*/
lineNumbers?: boolean

/**
* Print `js-lingui-id: Xs4as` statement in extracted comments section
*
* @default false
*/
printLinguiId?: boolean

/**
* By default, the po-formatter treats the pair `msgid` + `msgctx` as the source
* for generating an ID by hashing its value.
Expand All @@ -76,8 +76,32 @@ export type PoFormatterOptions = {
* @default false
*/
explicitIdAsDefault?: boolean

/**
* Print values for unnamed placeholders as comments for each message.
*
* This can give more context to translators for better translations.
*
* By default first 3 placeholders are shown.
*
* Example:
*
* ```js
* t`Hello ${user.name} ${value}`
* ```
*
* This will be extracted as
*
* ```po
* #. placeholder {0}: user.name
* msgid "Hello {0} {value}"
* ```
*
* @default true
*/
printPlaceholdersInComments?: boolean | { limit?: number }
}
```
````

## License

Expand Down
2 changes: 1 addition & 1 deletion packages/format-po/src/po.ts
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ export type PoFormatterOptions = {
* This will be extracted as
*
* ```po
* #. ph: {0} = user.name
* #. placeholder {0}: user.name
* msgid "Hello {0} {value}"
* ```
*
Expand Down

0 comments on commit 435bcc3

Please sign in to comment.