Module:Dates/locales

From OpenStreetMap Wiki
Jump to navigation Jump to search
[Edit] [Purge] Documentation

This table maps ISO language code or IETF language tags to date and date range formats used by {{Event date}} (via Module:Dates). The formats in this module are loosely based on CLDR, specifically the sections “medium”, “MMMd/d”, “MMMd/M”, and “yMMMd/y”.

Structure

A format date contains four keys:

  • sameDay – for when something lasts only one day
  • sameMonth – for when something lasts multiple days within the same month
  • sameYear – for when something ends in a different month than it started
  • different – for when something ends in a different year than it started

Each key is set to a table containing one or two format strings. The first string determines the return value’s overall format. If specified, the second string formats the end date, which is then inserted into the main formatted string, replacing the placeholder.

The format string syntax (other than the placeholder) is described in the ParserFunctions extension's documentation.

See also

local formatsByLanguage = {
	-- br, ca, co, de, en, fr, gcf, ht, it, nds, nds-nl, nl, oc, ru, uk
	["de"] = {
		sameDay = {"j. M"},
		sameMonth = {"j.–… M", "j."},
		sameYear = {"j. M – …", "j. M"},
		different = {"j. M Y – …", "j. M Y"},
	},
	["en"] = {
		sameDay = {"j M"},
		sameMonth = {"j–… M", "j"},
		sameYear = {"j M – …", "j M"},
		different = {"j M Y – …", "j M Y"},
	},
	["es"] = {
		sameDay = {"j \"de\" M"},
		sameMonth = {"j–… \"de\" M", "j"},
		sameYear = {"j \"de\" M – …", "j \"de\" M"},
		different = {"j \"de\" M \"de\" Y – …", "j \"de\" M \"de\" Y"},
	},
	["fa"] = {
		sameDay = {"j M"},
		sameMonth = {"j تا … M", "j"},
		sameYear = {"j M تا …", "j M"},
		different = {"j M Y تا …", "j M Y"},
	},
	["hu"] = {
		sameDay = {"M j."},
		sameMonth = {"M j.–…", "j."},
		sameYear = {"M j. – …", "M j."},
		different = {"Y M j. – …", "Y M j."},
	},
	["ko"] = {
		sameDay = {"n월j일"},
		sameMonth = {"n월j일 ~ …", "j일"},
		sameYear = {"n월j일 ~ …", "n월j일"},
		different = {"Y년n월j일 ~ …", "Y년n월j일"},
	},
	["lv"] = {
		sameDay = {"j. M"},
		sameMonth = {"j.–… M", "j."},
		sameYear = {"j. M – …", "j. M"},
		different = {"Y. \"gada\" j. M Y – …", "Y. \"gada\" j. M"},
	},
	["no"] = {
		sameDay = {"j. M"},
		sameMonth = {"j.–… M", "j."},
		sameYear = {"j, M – …", "j. M"},
		different = {"j. M Y – …", "j. M Y"},
	},
	["ru"] = {
		sameDay = {"j. M"},
		sameMonth = {"j.–… M", "j."},
		sameYear = {"j. M – …", "j. M"},
		different = {"j. M Y г. – …", "j. M Y г."},
	},
	["sr"] = {
		sameDay = {"j. M"},
		sameMonth = {"j.–… M", "j."},
		sameYear = {"j. M – …", "j. M"},
		different = {"j. M Y. – …", "j. M Y."},
	},
	["ja"] = {
		sameDay = {"n月j日"},
		sameMonth = {"n月j日~…", "j日"},
		sameYear = {"n月j日~…", "n月j日"},
		different = {"Y年n月j日~…", "Y年n月j日"},
	},
	["zh"] = {
		sameDay = {"n月j日"},
		sameMonth = {"n月j日至…", "j日"},
		sameYear = {"n月j日至…", "n月j日"},
		different = {"Y年n月j日至…", "Y年n月j日"},
	},
}

formatsByLanguage["es-419"] = formatsByLanguage.es
formatsByLanguage["es-ar"] = formatsByLanguage.es
formatsByLanguage["es-cl"] = formatsByLanguage.es
formatsByLanguage["es-es"] = formatsByLanguage.es
formatsByLanguage["es-mx"] = formatsByLanguage.es
formatsByLanguage["es-pe"] = formatsByLanguage.es
formatsByLanguage["es-ur"] = formatsByLanguage.es
formatsByLanguage.pt = formatsByLanguage.es
formatsByLanguage["pt-br"] = formatsByLanguage.pt
formatsByLanguage["pt-pt"] = formatsByLanguage.pt

formatsByLanguage.cs = formatsByLanguage.no
formatsByLanguage.da = formatsByLanguage.no
formatsByLanguage.dsb = formatsByLanguage.no
formatsByLanguage.et = formatsByLanguage.no
formatsByLanguage.fo = formatsByLanguage.no
formatsByLanguage.gsw = formatsByLanguage.no
formatsByLanguage.hsb = formatsByLanguage.no
formatsByLanguage.is = formatsByLanguage.no
formatsByLanguage.lb = formatsByLanguage.no
formatsByLanguage.nb = formatsByLanguage.no
formatsByLanguage.nn = formatsByLanguage.no
formatsByLanguage.sk = formatsByLanguage.no
formatsByLanguage.sl = formatsByLanguage.no
formatsByLanguage.wae = formatsByLanguage.no

formatsByLanguage.bg = formatsByLanguage.ru

formatsByLanguage.bs = formatsByLanguage.sr
formatsByLanguage.hr = formatsByLanguage.no
formatsByLanguage["bs-cyrl"] = formatsByLanguage.sr
formatsByLanguage["sr-cyrl"] = formatsByLanguage.sr
formatsByLanguage["sr-latn"] = formatsByLanguage.sr

formatsByLanguage.yue = formatsByLanguage.zh
formatsByLanguage["zh-cn"] = formatsByLanguage.zh
formatsByLanguage["zh-hans"] = formatsByLanguage.zh
formatsByLanguage["zh-hant"] = formatsByLanguage.zh
formatsByLanguage["zh-sg"] = formatsByLanguage.zh
formatsByLanguage["zh-tw"] = formatsByLanguage.zh

return formatsByLanguage