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

Plural not working #153

Open
Isigar opened this issue Apr 25, 2018 · 1 comment
Open

Plural not working #153

Isigar opened this issue Apr 25, 2018 · 1 comment

Comments

@Isigar
Copy link

Isigar commented Apr 25, 2018

Hello,
i have simple project where i use this package and i cant get working variant of plural translation...

Composer

{
	"name": "nette/sandbox",
	"description": "The sandbox is a pre-packaged Nette Framework project, basic configured structure for your application.",
	"homepage": "https://nette.org",
	"type": "project",
	"license": ["BSD-3-Clause", "GPL-2.0", "GPL-3.0"],
	"authors": [
		{
			"name": "David Grudl",
			"homepage": "https://davidgrudl.com"
		},
		{
			"name": "Nette Community",
			"homepage": "https://nette.org/contributors"
		}
	],
	"require": {
		"php": ">=5.6.0",
		"nette/application": "^2.4.4",
		"nette/bootstrap": "^2.4.3",
		"nette/caching": "^2.5",
		"nette/database": "^2.4",
		"nette/di": "^2.4",
		"nette/finder": "^2.4",
		"nette/forms": "^2.4",
		"nette/http": "^2.4",
		"nette/mail": "^2.4",
		"nette/robot-loader": "^2.4 || ^3.0",
		"nette/safe-stream": "^2.3",
		"nette/security": "^2.4",
		"nette/utils": "^2.4",
		"latte/latte": "^2.4",
		"tracy/tracy": "^2.4",
		"dg/adminer-custom": "^1.9",
		"kdyby/doctrine": "^3.3",
		"ublaboo/datagrid": "^5.5",
		"kdyby/translation": "^2.5"
	},
	"require-dev": {
		"nette/tester": "^2.0"
	},
	"minimum-stability": "stable",
	"config": {
		"platform": {
			"php": "5.6"
		}
	}
}

Translate file

dashboard:
    from: Od
    to: Do
    left: "Zbývající čas"
    lower_day: "Méně než den"
    day: "den|%count% dní"
    month: "1 měsíc|%count% měsíců"
    year: "1 rok|%count% roky"

Everything work only plural not. Its show full string but placeholder changed by value that i set

Use in presenter

{_page.dashboard.year, ["count" => $diff->y]}
i tested both
{_page.dashboard.year, $diff->y}

Thanks for any response & sorry for my bad english :)

@lulco
Copy link
Contributor

lulco commented Nov 30, 2018

try this:

day: "{1} den|[2,Inf] %count% dní

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants