sourceapplocalescy.js

/* cy - Welsh */

const help = {
	countRaw: new Intl.PluralRules("cy-GB"),
	numRaw: new Intl.NumberFormat("cy-GB"),
	verbalNum: (n, gender = "m") => {
		if (n % 1 || n < 0 || n > 10) {
			return help.num(n);
		}

		if (gender == "f" && n <= 4) {
			return ["sero", "un", "dwy", "tair", "pedair"][n];
		}

		return ["sero", "un", "dau", "tri", "pedwar", "pum", "chwe", "saith", "wyth", "naw", "deg"][n];
	},

	sentenceCase: x => `${x[0].toUpperCase()}${x.slice(1)}`
};
help.count = help.countRaw.select.bind(help.countRaw);
help.num = help.numRaw.format.bind(help.numRaw);

const locale = grimm => ({
	meta: {
		id: "cy",
		code: "cy-GB",

		name: "Cymraeg",
		sort: "cymraeg",
		flag: "gb/wls",

		fallback: ["en"],
		intlFallback: ["cy-GB", "en-GB"]
	},
	help: help,
	pan: {
		indexLink: "Yn ôl i’r hafan",
		baseSiteName: "Y Goedwig y Satyriaid 🍇",
		circa: x => `tua ${x}`,
		dateSep: " / ",
		pageHistory: {
			added: date => `Tudalen wedi’i hychwanegu at y safle: ${grimm.date.dual("cy", date)}`,
			created: date => `Tudalen wedi’i chreu: ${grimm.date.dual("cy", date)}`,
			published: date =>
				`Cyhoeddwyd gyntaf: ${grimm.date.dual("cy", date)}`,
			translated: date =>
				`Tudalen wedi’i chyfieithu: ${grimm.date.dual("cy", date)}`,
			updated: date => `Tudalen wedi’i diweddaru: ${grimm.date.dual("cy", date)}`
		}
	},
	comments: {
		header: n =>
			`${help.sentenceCase(help.verbalNum(n))} sylw`,
		headerNone: "Gadael sylw",
		saysBefore: "",
		saysAfter: " meddai…",
		reply: "Ymateb i’r sylw hwn",
		name: "Enw",
		namePlaceholder: "Dafydd ap Dafydd",
		email: "E-bost (<i>Trap sbam — peidiwch â llenwi hwn os ydych yn berson go iawn!</i>)",
		website: "Gwefan",
		websitePlaceholder: "https://dafydd.cymru",
		tripcode: "Gair cyfrinachol",
		optional: " (<i>dewisol</i>)",
		textarea: "Gadewch eich sylw",
		textareaPlaceholder: "Cryf aberth yw nerth, nid yn aer—treiswyr eithr mywn trawswyrth didaer…",
		textareaRules:
			"Byddwch yn garedig, os gwelwch yn dda. Gall sylwadau gael eu golygu ar gyfer sillafu a phriflythrennu priodol, oherwydd fy mod yn bedant. Fformatio sylfaenol: <code><b>*bras*</b></code>, <code><i>/italig/</i></code>, <code>[//satyrs.eu dolenni]</code>… <a href='/comments'>→ Mwy</a>",
		select: "(Gwrth-sbam) Ar ba blaned rydych yn byw?",
		selectDefault: "Dewiswch…",
		selectBellerophon: "Bellerophon",
		selectEarth: "Y Ddaear",
		selectMercury: "Mercwri",
		selectOmicron: "Omicron-5",
		selectVulcan: "Vulcan",
		submit: "Cyflwyno",
		confirmed: "Mae eich sylw wedi’i gyflwyno!",
		closed: "Mae sylwadau ar y cofnod hwn bellach wedi’u cau."
	},
	misrule: {
		siteName: "Lords of Misrule",
		indexLink: "Mwy o Lords of Misrule"
	}
});

export default locale;