Module:auto cat >> Module:auto cat/data   << Module:auto cat/τεκμηρίωση
Module:auto cat >> Module:auto cat/data (γενικές, γραμματική, ετυμολογία)
Module:auto cat >> Module:auto cat/data/topics (θεματικές as in topic labels at Module:labels/data)
Module:auto cat >> Module:auto cat/data/style (υφολογικές as in style labels at Module:labels/data)
Module:auto cat >> Module:auto cat/data/toposkind (τοπωνύμια as in placenames at Module:topos/kind)
Module:auto cat >> Για κάθε αλλαγή ενημερώνουμε και το Module:auto cat (function get_toposkind_id)
Module:auto cat >> τόποι της... places of...       (as in where at Module:topos/where)
Module:auto cat >> Module:Languages       & Module:Languages/cat (γλώσσες)
Module:auto cat >> Module:auto cat/param-prefix-id πρόθημα ωωω από το χχχ (normalize prefixes)
and all SUBPAGES


-- [[wikt:el:Template:auto cat]]
-- https://el.wiktionary.org/wiki/Ειδικό:ΤιΣυνδέειΕδώ/Πρότυπο:auto_cat
-- [[:Κατηγορία:Σελίδες με manual auto cat]] -- {{auto cat|text=...}} ή {{auto cat|iso=xx|text=....}}
-- [[:Κατηγορία:Σελίδες με σφάλμα στο auto cat]]
-- [[:Κατηγορία:Σελίδες με σφάλματα δέσμης ενεργειών]]
-- $to do: CATFIX precise links of words -- .js needed
-- to do: marked with $ missing or problems with #
--[=[
2020.11.11. Sarri.greek (wish it were better and shorter) Since noone understands Lua here
	I copied bits and pieces from elsewhere until we got the desired output.
	For future Lua-editors: We, the Lua-illetterate people, need to SEE both breadcrumb and Categories one by one, together
	in order to be able to correct them in unison.
	But it would be nice if Etymology or Topos sections were separate. Thank you!
IN GREEK ================
-- Στις σελίδες Κατηγοριών, το [[Πρότυπο:auto cat]] προσθέτει τιτλάκι με Κατηγορίες στην κορυφή της σελίδας
	και κατηγοριοποιεί στο τέλος της σελίδας.
-- Οι Κατηγορίες στο el.wiktionary έχουν πάντοτε τη μορφή
	Κατηγορία:Τίτλος
	ή
	Κατηγορία:Τίτλος (όνομαγλώσσας)
	Ειδικοί δείκτες:
	* η λέξη 'από' για ετυμολογικές κατηγορίες όπως στο [[Module:Languages]].apota = από την τάδε γλώσσα
		π.χ. [[:Κατηγορία:Δανεισμοί από τα αγγλικά]]
	* απλή παύλα ' - ' για θεματικές ετυμολογικές κατηγορίες π.χ.[[:Κατηγορία:Δάνεια - ονόματα]]
		(όμως καλύτερα να αποφεύγεται, δημιουργεί προβλήματα)
	* η γενική του άρθρου 'της / του / των' για κατηγορίες τόπων π.χ. [[:Κατηγορία:Τοπωνύμια της Ελλάδας]]
ΔΟΜΗ
1)	προκαταρκτικά, mode a, mode b
	text= & cat= in mode a (χωρίς γλώσσα) & mode b (με γλώσσα στην παρένθεση)
	// TO DO: CATFIX // 
	//FREE manual text
else:

2)	// Κατηγορίες γλωσσών όπως στο [[Module:Languages/cat]] // ειδικά για συγκεκριμένες γλώσσες
3) απλοί τίτλοι lables [[Module:labels]] & άλλα Πρότυπα
	// level_1, by_lang //  label  από το [[Module:auto cat/data]] από το [[Module:labels/data]] gramm=true, etym=true//
	// topics (Θεματικές κατηγορίες) όπως στο [[Module:auto cat/data/topics]] από το [[Module:labels/data]] topics=true // 
	// υφολογικές όπως στο [[Module:auto cat/data/style]] από το [[Module:labels/data]] style=true // 
4) τίτλοι με δείκτες
	// λέξεις με πρόθημα... - με ένθημα... - με επίθημα... - με συνθετικό... / με υποκοριστικό επίθημα..., με μεγεθυντικό επίθημα... //
		// Κύρια ονόματα: πρόθημα σε ονομασίες - επίθημα σε ονομασίες όπως επώνυμα κλπ
		// phrasal verbs με //
	// ΕΤΥΜΟΛΟΓΙΑ 
		-- Functions apota (από τα ... γλώσσα) 
			1)κλη, προέ, παραγωγή 2) δανεισμοί  3) διαχρονικά και λόγια δάνεια
		-- apota + όνομα/επώνυμο/τοπωνύμιο      
		-- Functions apotin root για ΠΙΕ Πρωτοϊνδοευρωπαϊκές ρίζες (η ρίζα με πλάγια) -Έχουν μόνο 'προέλευση' (όχι κλη, δαν)
			1) προέλευση από xxx (langapotin + ρίζα) 2) apota + ρίζα για τα αραβικά 3) apota + ανά γλώσσα 4) title apota + ρίζες ανά γλώσσα
5) ΤΟΠΩΝΥΜΙΑ ([[Module:topos]]		
	//  Γενικοί τίτλοι: τοπωνύμια 
	// με δείκτες: κατάλογος τίτλοων / Functions τοπωνύμια+της.. του.. των + χώρα ή ήπειρος όπως στο [[Module:topos/kind]] & [[Module:topos/where]]
6) output
IN ENGLISH================
-- At category pages: Κατηγορία:... [[Template:auto cat]] adds a title-row (breadcrumb) and categorizes at bottom.
	Some categories cannot be supported by auto cat (see output).
-- Categories in el.wiktionary are of the form
	Category:Title
	or
	Category:Title (languagename)
	Special markers:
	* the word 'από' for etymological categories: [[Module:Languages]].apota = from...xx language
		Category:Title languages.apota e.g. [[:Κατηγορία:Δανεισμοί από τα αγγλικά]]
	* dash ' - ' for etymological subjects e.g. [[:Κατηγορία:Δάνεια - ονόματα]]
		(to be avoided in the future)
	* the genitive articles 'της / του / των' for places 'from X country' e.g. [[:Κατηγορία:Τοπωνύμια της Ελλάδας]]
STRUCTURE
1)	preliminaries, mode a, mode b
	text= & cat= in mode a (without language) & mode b (with language)
	// TO DO: CATFIX // 
	// FREE manual text
else

2)	// Language Categories as in [[Module:Languages/cat]] // language specifics
3) simple titles from [[Module:labels]] & other Templates
	// level_1, by_lang //  labels as in [[Module:auto cat/data]] from [[Module:labels/data]] gramm=true, etym=true//
	// topics (Subjects) as in [[Module:auto cat/data/topics]] from [[Module:labels/data]] topics=true // 
	// style&usage as in [[Module:auto cat/data/style]] from [[Module:labels/data]] style=true // 
4) titles with markers
	// Words with prefix... - with infix... - with suffix... / with combinging form... / with diminutive suffix..., with augmentative suffix... //
		// ProperNouns: prefix+names, suffix+names // phrasal verbs with //
	// ETYMOLOGY 
		-- Functions apota (from...language) 
			1)inh, der, creation 2) borrowings  3) diachronic and learned borrowings 
		-- apota + name/surname/placename: όνομα/επώνυμο/τοπωνύμιο      
		-- Functions apotin root for PIE ProtoIndoEuropean roots (the root in italics) -This has only etym (not inh, bor
			1) etym from xxx (langapotin + root) 2) apota + -root for arabic roots 3) apota + by language 4) title apota + roots by language
5) PLACENMAES ([[Module:topos]]		
	// General titles: toponyms 	
	// with markers: list of titles / Functions toponyms of+της.. του.. των + coungry or continent as in [[Module:topos/kind]] & [[Module:topos/where]]
6) output

TEXT: The title-row (breadcrumb) may begin with
	mode a, level 0: [[Κατηγορία:Βικιλεξικό|Κατηγορίες]] = the first fundamental cat
	mode b, level 0: Κατηγορία:γλώσσα τάδε = a specific language 
	+for hosted subordinate phases cf. ελληνιστική κοινή which always appear with their host language
			
TEXT with its parents has the form
	... >> parent4 >> parent3 >> parent2 >> parent >> THE CATEGORY << extra0 OR extra1
Categorization for the Category includes:
	the general Categories assigned by the module and if they exist: parent - extra1 - extra2 - extra3
	extra0 does not create a Category

HOW
 Read the title of the page. Examine if there is a parenthesis. Extract the title (cat_title). 
 Extract what is in the parenthesis.  What is in the parenthesis is a language.name. ([[Module:Languages]] keyword:name)
 Extract from language.name the language.iso as at required [[Module:Languages]] via a required function from [[Module:lang]]. 
 If the iso field in Languages is wrong or empty, give error. -- $CANNOT do ERROR for WRONG language names
 Also: extract the expressions 'apota' (from the) titles if they match to [[Module:Languages]] apota. This is the donor language and has lang_iso2. 
 Also: extract affixes - extract expressions 'from xxx country' for placnames.
NOTES
	NO  br at end of text
	AVOID dash in title in the future - ΝΑ ΜΗΝ ΕΒΑΖΑ παύλες μέσα σε τίτλους καλύτερα. Έχουν μονίμως πρόβλημα.
	
PROBLEMS#
* function apota: -- PROBLEMATIC: [[:Κατηγορία:Προέλευση λέξεων από τουρκικές γλώσσες (νέα ελληνικά)]] MUST NOT and not mw.ustring.find(cat_title, 'από το')
	ΔΙΟΡΘΩΣΗ ΣΥΧΝΟΥ ΠΡΟΒΛΗΜΑΤΟΣ: αν κάποια Κατηγορία δίνει error: bad argument #1 to 'sub' (string expected, got nil).
	μάλλον φταίει ότι μέσα στην έκφραση υπάρχει το «απο» Παράδειγμα: [[:Κατηγορία:Αριθμητικά απόλυτα]]
	Θα πρέπει να πάμε ΣΕ ΟΛΕΣ τις περιπτώσεις ΕΞΑΙΡΕΣΕΩΝ ΕΤΥΜΟΛΟΓΙΑ για τον δείκτη apota προσθέτοντας:  and not mw.ustring.find(cat_title, 'απόλυτα')
* topos+where. REDO IT. CANNOT toposwhere label = topos kind id. 
		Cannot toposwhere_label.descr [[:Κατηγορία:Διαμερίσματα της Ελλάδας]]
TO DO $ ΕΚΚΡΕΜΟΤΗΤΕΣ #
	* sublang (subordinate languages) EVERYWHERE (it is missing in many places, especially Etymology)
	* TO DO -- NEED precise link to the LanguageSection in categories. See CATFIX
		e.g. members of [[:Κατηγορία:Τρόφιμα (γαλλικά)]] should link to Section Γαλλικά (fr)
		that is Κατηγορία:Title (Module:Languages.name) should link to page#Module:Languages.link
	* sort weird: [[Άργος]] placenameAPOTA for κλη, προέλ The alpha+tonos is not sorted, as other capitals eg. [[Όλυμπος]] [[Ίλιο]]
	* param nohost=1 for la-new e.g. for Κατηγορία:Σημασιολογικά δάνεια από τα αγγλικά (νεολατινικά) this is not needed: Κατηγορία:Σημασιολογικά δάνεια από τα αγγλικά (λατινικά)

Standard TESTS for apota (means from+neuter plural name at [[Module:Languages]].apota for languages and subordinate languages (sublang)
	apota languages are iso2, the language in parentheses is iso
	Do not allow extra etymology text or Category with languages[lang_iso].host_iso == languages[lang_iso2].iso
For mode a
* apota language
	xxxx από τα αγγλικά
* apota sublang (check if host_iso appears)
	xxxx από τα ποντιακά (pnt sublang of el)
For mode b
* 1)  apota language iso2 (sublang iso)  = if languages[lang_iso].sublang == true and not languages[lang_iso2].sublang == true then
	xxxx από τα λατινικά (ποντιακά) = from la (pnt, its host_iso is el)
	xxxx από τα νέα ελληνικά (ποντιακά) = from el (pnt, its host_iso is el) -- do not give Category or plustext
* 2) apota sublang iso2 (language iso) = elseif languages[lang_iso2].sublang == true and not languages[lang_iso].sublang == true then
	xxxx από τα ποντιακά (λατινικά) = from pnt, its host_iso is el (la)
	xxxx από τα ποντιακά (νέα ελληνικά) = from pnt, its host_iso is el (el) -- do not give Category or plustext
* 3) apota sublang iso2 (sublang iso2) = elseif languages[lang_iso].sublang == true and  languages[lang_iso2].sublang == true then
	xxxx από τα ποντιακά (νεολατινικά) = from pnt, its host_iso is el (la-new, its host_iso is la)
	xxxx από τα ποντιακά (καθαρεύουσα) = from pnt, its host_iso is el (kath, its host_iso is el)  -- do not give Category or plustext
* 4) apota language iso2 (sublang iso)  = else (both are languages)
	xxxx από τα λατινικά (νέα ελληνικά)

]=]--

local export = {}

local module_path = 'Module:auto cat/' -- WRITE local, otherwise it looks for /param pages in OTHER modules!


-- MODULES needed
local m_page = require("Module:page") -- splits page's name in parts
	-- call with  m_page.nameofthefunctionneeded(xx)
local m_utilities = require("Module:User:Sarri.greek/utilities")
	-- call with m_utilities.nameofFunction
	-- function sorkey for SUFFIX  autosort
--also, modules used:
-- βλ. γλώσσες [[Module:lang]] -- get language codes and keywords  - κωδικούς γλωσσών
-- βλ. Τοπωνύμια: [[Module:topos/functions]]	-- handles keywords of placenames


-- Expanded [[Template:title]] from [[Module:title]] - at APPLICATIONS langapotin -- italics at root *...- Categories
	-- text_plus = "\n" .. frame:expandTemplate{ title = 'title', args = {'root'} } .. "\n"

-- DATA-ONLY-MODULES needed
local languages = mw.loadData("Module:Languages") -- all language keywords are in here
	-- call with languages[language_iso].somekeyword (first, need to make language_iso)
local cat_languages = mw.loadData("Module:Languages/cat") -- gives the iso for [[Module:Languages]]
	-- call with cat_languages.lang[page_text] with page_text, to match ALL title
local data = mw.loadData("Module:auto cat/data") 
	-- call with data.level_1[cat_title]
	-- call with data.level_1bylang[cat_title]
	-- call with data.label[cat_title].somekeyword or data.label[cat_title]['somekeyword']
-- ##?? TO DO: how can I cobmine to local data the topics and style ??
local topics = mw.loadData("Module:auto cat/data/topics") -- corresponds to [[Module:labels/data]] only at Θεματικές section
	-- call with topics.label[cat_title].somekeyowrd or topics.label[cat_title]['somekeyword']
local style = mw.loadData("Module:auto cat/data/style") -- labels for style found in [[Module:labels/data]]
	-- call with style.label[cat_title].somekeyword or style.label[cat_title]['somekeyword']

local topos = mw.loadData("Module:topos/kind")		-- all placename keywords are in here
	-- call with topos[toposid].somekeyword (first, need to make toposid)
local toposkind = mw.loadData("Module:auto cat/data/toposkind")	-- repetition of all placename keywords
	-- call with toposkind.label[cat_title].somekeyword
	-- I need it only to get the key for m_topos
	-- but i need to do HERE all the if title ... then cat_title... (see TOPOS SECTION)

-- and [[Module:auto cat/param-prefix-id]] for different senses of prefixes

-- parameters ========================
	local page_text = m_page.pagetext(xx)	-- Title + (textparenthesis) if there is one
	local cat_title = m_page.pagetitle(xx)	-- Title WITHOUT (textinparenthesis)
	local cat_parenthesis = m_page.pageparenthesis(xx)	-- (textinparenthesis)
	local cat_lang = ''	-- textofparenthesis without brackets = the language name in the category titles
	local lang_name = ''
	local lang_cat = ''
	local lang_key = ''
	
-- Exception: See Etymology e.g. [[:Κατηγορία:Προέλευση λέξεων από τα γαλλικά]]
	local lang_apota = ''	-- donor language as 'apota' in [[Module:Languages]], it gets lang_iso2 -- only for some categories - OK
							-- e.g. gives iso2 = 'fr'
	local apota_text = ''	-- e.g. gives από τα γαλλικά
	local apota_label = ''	-- e.g. gives Προέλευση λέξεων
	local length = ''		-- length of από τα γαλλικά
-- βλ. also see Etymology: honost
-- βλ. also see affixes Προσφύματα: -- local sort, alt, show_other, other_link, other_cat, nohost, host_lemma
-- βλ. also see TOPOS placenames Τοπωνύμια: toposid, whereid

								
-- =========================== MAIN FUNCTION  =========================== --

function export.main(frame)
	local args = frame:getParent().args	-- only for Templates -- [[Template:auto cat]]
--	local args = frame.args			-- only for direct invoke
	local text = ''				-- the sequence of Categories, see output
	local text_plus = ''			-- extra text. see output
	local cat = ''				-- the categorizations at bottom of page, see output


--------------------------------------------------------------------------
--             for a) without language and b) with language             --
--------------------------------------------------------------------------

-- MODE a = without language
	if cat_parenthesis == '' or cat_parenthesis == nil then
		cat_lang = ''
		-- iso1 is not needed here, there is no language-specific category
		lang_iso2 = args['iso2'] or '' -- in case editor needs to fill parameter for a donor language (e.g. at FREE auto cat)
		lang_name = '' 
		lang_cat = ''
		lang_key = ''
		lang_apota = ''
		
		if lang_iso ~= '' and lang_iso ~= nil then
			lang_name = languages[lang_iso].name
			lang_cat = languages[lang_iso].cat
		else
			lang_cat = ''
		end
		if lang_iso2 ~= '' and lang_iso2 ~= nil then
			lang_apota = languages[lang_iso2].apota
		else
			lang_apota = ''
		end
-- MODE b WITH language in the parenthesis
	else
		cat_lang = m_page.pagelang(xx)	-- textofparenthesis without brackets = the language name in the category titles

	   	lang_iso = args['iso'] or '' -- in case editor needs to fill parameter NOT USED
			-- get the iso from cat_lang (which is [[Module:Languages]] the 'name'  see [[Module:lang]])
			if cat_lang ~= '' and cat_lang ~= nil then
				lang_iso = require("Module:lang").langname_to_langiso(cat_lang) -- DO NOT USE the function name_to_iso, it will not work here
			end
	   	lang_iso2 = args['iso2'] or '' -- in case editor needs to fill parameter -- NOT USED
		lang_name = languages[lang_iso].name -- = in the parenthesis cat_lang
		lang_cat = languages[lang_iso].cat
		lang_key = languages[lang_iso].key

		lang_apota = ''
		if lang_iso2 ~= '' and lang_iso2 ~= nil then
			lang_apota = languages[lang_iso2].apota
		else
			lang_apota = ''
		end
		lang_specific = args['γλ'] or args['lang'] or ''	-- applied at: GENERAL DATA, at TOPICS
		
	-- PREPARED texts with language
		-- [[:Κατηγορία:Ετυμολογία (ελληνιστική κοινή)]] -- [[:Κατηγορία:Δάνεια από τα λατινικά (ελληνιστική κοινή)]]
		if languages[lang_iso].sublang == true then
			text_lang = '[[:Κατηγορία:Κατάλογος γλωσσών|Γλώσσα]]: ' 
			.. '[[:Κατηγορία:' .. languages[lang_iso].host .. '|<b>' .. languages[lang_iso].host_show .. '</b>]] - [[:Κατηγορία:' 
			.. lang_cat .. '|' .. lang_cat .. ']]'
		else
			text_lang = '[[:Κατηγορία:Κατάλογος γλωσσών|Γλώσσα]]: ' 
			.. '[[:Κατηγορία:' .. lang_cat .. '|<b>' .. mw.getContentLanguage():ucfirst(lang_name) .. '</b>]]'
		end		
		textit_lang = ' » [[:Κατηγορία:' .. cat_title .. ' (' ..	lang_name .. ')|' .. cat_title .. ']]'
	-- for placenames: Does is create problems??
--		text_topos_lang = text_lang .. ' » [[:Κατηγορία:Θεματικές κατηγορίες (' .. lang_name .. ')|Θεματικές κατηγορίες]]' 
--		.. ' » [[:Κατηγορία:Ονομασίες (' .. lang_name .. ')|Ονομασίες]] » [[:Κατηγορία:Τοπωνύμια (' .. lang_name ..  ')|Τοπωνύμια]]'
		
	end
	
-- DO NOT MOVE up this section
	-- PREPARED  texts without language (mode a)
-- level 0, general
	textit = ' » [[:Κατηγορία:' .. cat_title .. '|' .. cat_title .. ']]'
	text_wikt = '[[:Κατηγορία:Βικιλεξικό|<b>Κατηγορίες</b>]]'
-- etymology derived
	descr_der = 'Η προέλευση των λέξων από γλώσσα σε γλώσσα έως την απώτατη αρχή τους με κάθε είδος ετυμολογικής σχέσης.'
-- topos for placenames - Does it create problems??
--	text_topos = text_wikt .. ' » [[:Κατηγορία:Θεματικές κατηγορίες|Θεματικές κατηγορίες]]' 
--	.. ' » [[:Κατηγορία:Ονομασίες|Ονομασίες]] » [[:Κατηγορία:Τοπωνύμια ανά είδος|Τοπωνύμια]]' 

-------------------------------------------------------------------------- $TO DO needs interface admin
--                               CATFIX                                 --
-- the words in every Category with precise links to Language Sections  --
--------------------------------------------------------------------------
--[=[
	* NEED precise link to the LanguageSection in categories. See CATFIX
		e.g. members of [[:Κατηγορία:Τρόφιμα (γαλλικά)]] should link to Section Γαλλικά (fr)
		what is in parenthesis is ALWAYS the language name
		that is Κατηγορία:Title (Module:Languages.name) should link to page#Module:Languages.link
Instructions at https://en.wiktionary.org/wiki/Wiktionary:Grease_pit/2021/June#Links_from_categories
What we do is insert the HTML code created by <code>require "Module:utilities".catfix(language_object, optional_script_code)</code> 
into category pages, and then run [[MediaWiki:Gadget-catfix.js]] to transform the category links. 
The gadget is installed [[MediaWiki:Gadgets-definition#Hidden_gadgets_and_utils|here]] 
so that it is loaded efficiently by the server. 
The catfix HTML is inserted either by calling the module function in the module functions that generate category descriptions
(for instance in many categories that are added by {{temp|autocat}}) 
or by using {{temp|catfix}} in a page. So it's a combination of a module and a JavaScript gadget. — [[wikt:en:User:Erutuon]]

-- here, in el.wiktionary we have:
if cat_parenthesis == '' or cat_parenthesis == nil then -- there is NO LANGUAGE or uni, or mul or el
	-- do nothing
else -- There is a language name in parenthesis. See above, mode b
	-- cat_title is the Title of page WITHOUT parenthesis
	-- cat_lang = m_page.pagelang(xx)	-- textofparenthesis without brackets = the language name in the category titles
	-- i have the iso of the language: lang_iso = require("Module:lang").langname_to_langiso(cat_lang)
	-- lang_name = languages[lang_iso].name -- = in the parenthesis cat_lang
	-- we need the id anchor to language Sections in pages. This is  lang_cat = languages[lang_iso].cat
	-- make link:
	-- [[xxxx#lang_cat]]
	
if cat_parenthesis == '' or cat_parenthesis == nil 
or cat_parenthesis == 'διεθνείς όροι' or cat_parenthesis == 'διαγλωσσικοί όροι' -- uni, mul universal & transligual terms, are alwyas on top of page
or cat_parenthesis == 'νέα ελληνικά' -- el at top of page (very few pages have uni or mul on top of el, never mind)
then
	-- do nothing
else
	-- read the lang_name in the parenthesis and get the iso
	cat_lang = m_page.pagelang(xx)
	lang_iso = require("Module:lang").langname_to_langiso(cat_lang)
	-- create a link to the iso of the cat_parenthsis language, whith is  #languages[lang_iso].link 
	-- [[xxx#languages[lang_iso].link]] ??? how do i write it??
	
end -- close catfix
	
]=]--


--------------------------------------------------------------------------
--                               FREE                                  --
-- write breadcrumb free text - you need to add categories manually, [[Template:κατ]]
-- used e.g. in Categories for declensions
--------------------------------------------------------------------------
-- [[:Κατηγορία:Σελίδα για τεστ]] [[:Κατηγορία:Σελίδες με manual auto cat]]
-- ignore the titleword Κατηγορία (it may by an Appendix)  [[Παράρτημα:Ουσιαστικά (νέα ελληνικά)]] should not be confuse with [[:Κατηγορία:Ουσιαστικά (νέα ελληνικά)]]
	-- THIS doeσ not work if m_page.fullpagetext(xx) then (it is  mw.title.getCurrentTitle()  -- the FULL title of the page΄


if args['text'] ~= '' and args['text'] ~= nil then
	local lang_iso = args['iso'] or ''
	if args['iso'] ~= '' and args ['iso'] ~= nil then
		if args['iso'] == languages[lang_iso].iso then lang_iso = languages[lang_iso].iso end
		if languages[lang_iso].sublang == true then
		text = '[[:Κατηγορία:Κατάλογος γλωσσών|Γλώσσα]]: ' 
		.. '[[:Κατηγορία:' .. languages[lang_iso].host .. '|<b>' .. languages[lang_iso].host_show .. '</b>]]'
		.. ' - [[:Κατηγορία:' .. languages[lang_iso].cat .. '|'	.. mw.getContentLanguage():ucfirst(languages[lang_iso].name) .. ']]'		
		.. ' » ' .. args['text']
		else
		text = '[[:Κατηγορία:Κατάλογος γλωσσών|Γλώσσα]]: ' 
		.. '[[:Κατηγορία:' .. languages[lang_iso].cat .. '|<b>' .. mw.getContentLanguage():ucfirst(languages[lang_iso].name) .. '</b>]]'
		.. ' » ' .. args['text']
		end
		cat = '[[Κατηγορία:Σελίδες με manual auto cat]]'
	else -- no language iso
		text = '[[:Κατηγορία:Βικιλεξικό|<b>Κατηγορίες</b>]]'
		.. ' » ' .. args['text']
		cat = '[[Κατηγορία:Σελίδες με manual auto cat]]'
	end -- close iso=

else -- read all the following module

--------------------------------------------------------------------------
--                       Κατηγορίες γλωσσών                            --
--        Languages Categories, as in [[Module:Languages/cat]]         --
--------------------------------------------------------------------------
if cat_languages.lang[page_text] then
	-- PROBLEM dash παύλα [[:Κατηγορία:Σερβική γλώσσα - λατινικό αλφάβητο]] (no problem without dash)
	if page_text == 'Σερβική γλώσσα - λατινικό αλφάβητο' then language_iso = 'sr-la'
	elseif page_text == 'Λήμματα απλοποιημένης γραφής (κινεζικά)' then language_iso = 'zh2'
	else language_iso = cat_languages.lang[page_text].iso
	end
	if languages[language_iso].sublang == true then 
		-- [[:Κατηγορία:Αρχαία ελληνικά]] -- [[:Κατηγορία:Ελληνιστική κοινή]]
		text = '[[:Κατηγορία:Κατάλογος γλωσσών|Γλώσσα]]: ' 
		.. '[[:Κατηγορία:' .. languages[language_iso].host .. '|<b>' 
		.. languages[language_iso].host_show .. '</b>]] - [[:Κατηγορία:' 
		.. languages[language_iso].cat .. '|'
		.. mw.getContentLanguage():ucfirst(languages[language_iso].name) .. ']]'
		.. ' »  <i>επιλέξτε είδος κατηγορίας</i>'
		cat = '[[Κατηγορία:' .. languages[language_iso].host .. "|']]" ..  "\n"
		.. '[[Κατηγορία:Κατάλογος γλωσσών]]' ..  "\n" -- [[:Κατηγορία:Ποντιακά]] και αλφαβητικά στο Π
	else
		text = '[[:Κατηγορία:Κατάλογος γλωσσών|Γλώσσα]]: ' 
		.. '[[:Κατηγορία:' .. languages[language_iso].cat .. '|<b>' 
		.. mw.getContentLanguage():ucfirst(languages[language_iso].name) .. '</b>]]'
		if languages[language_iso].family == true then
		text = text .. ' »  <i>με ετυμολογικές κατηγορίες</i>'
		else
		text = text .. ' »  <i>επιλέξτε είδος κατηγορίας</i>'
		end
			
		cat = '[[Κατηγορία:Κατάλογος γλωσσών|' .. languages[language_iso].key .. ']]' ..  "\n"
		if languages[language_iso].family == true then 
		cat = cat .. '[[Κατηγορία:Οικογένειες γλωσσών|' .. languages[language_iso].key .. ']]' ..  "\n"
		end
		
	end
else
	 -- write nothing --It spoils all other page titles e.g. [[:Κατηγορία:Ουσιαστικά]]
end
	
-- ============== language specific - ειδικά για συγκεκριμένες γλώσσες ============== --
if page_text == 'Ελληνιστική σημασία για αρχαίες λέξεις' then
	text = '[[:Κατηγορία:Κατάλογος γλωσσών|Γλώσσα]]: ' 
	.. '[[:Κατηγορία:Αρχαία ελληνικά|<b>Αρχαία ελληνικά</b>]] - [[:Κατηγορία:Ελληνιστική κοινή|Ελληνιστική κοινή]]'
		.. ' »  σημασίες για αρχαίες λέξεις'
	cat = '[[Κατηγορία:Ελληνιστική κοινή| ]]' ..  "\n"
end

	
-- ============== and title specific - ειδικά για συγκεκριμένους τίτλους ============== --
-- Κατηγορία:Λήμματα με παραθέματα από τον Θουκυδίδη (αρχαία ελληνικά)
-- only in languages (specific glossaries with quotation of an author)
if mw.ustring.find(cat_title, "Λήμματα με παραθέματα")
and not mw.ustring.find(cat_title, "Λήμματα με παραθέματα %(")
and not data.label[cat_title]
then
	text = text_lang .. " » [[:Κατηγορία:Λήμματα με παραθέματα (" .. lang_name .. ")|Λήμματα με παραθέματα]]"
		.. ' » ' .. mw.ustring.gsub(cat_title, "Λήμματα με παραθέματα", "")
	cat = "[[Κατηγορία:Λήμματα με παραθέματα (" .. lang_name .. ")|Σ]]" ..  "\n" -- σ = συγκεκριμένοι συγγραφείς
end

--------------------------------------------------------------------------
--                         LEVEL 1                             --
-- as in [[Module:auto cat/data]] level_1
--------------------------------------------------------------------------

-- level_1 simple =========================
-- a1 Directly to Wiktionary. όλες όσες υπάγονται ΑΠΕΥΘΕΙΑΣ στο Βικιλεξικό, e.g. [[:Κατηγορία:Γραμματικές κατηγορίες]], [[:Κατηγορία:Ετυμολογία]]
if data.level_1[cat_title] then
	if cat_parenthesis == '' or cat_parenthesis == nil then
		text = text_wikt .. textit
		if data.level_1[cat_title]['extra0'] ~= '' and data.level_1[cat_title]['extra0'] ~= nil then
			text = text .. ' « [[:Κατηγορία:' .. data.level_1[cat_title]['extra0'] .. '|' .. data.level_1[cat_title]['extra0'] .. ']]'
		end		
		-- check [[:Κατηγορία:Φράσεις]]
		if data.level_1[cat_title]['extra1'] ~= '' and data.level_1[cat_title]['extra1'] ~= nil then
			text = text .. ' « [[:Κατηγορία:' .. data.level_1[cat_title]['extra1'] .. '|' .. data.level_1[cat_title]['extra1'] .. ']]'
		end			
		-- descr -- [[:Κατηγορία:Λήμματα με ηχητικά αρχεία]]
		if data.level_1[cat_title]['descr'] ~= '' and data.level_1[cat_title]['descr'] ~= nil then
			text_plus = '<dl><dd>' .. data.level_1[cat_title]['descr'] .. '</dd></dl>'
		end
			
		cat = '[[Κατηγορία:Βικιλεξικό|' .. data.level_1[cat_title]['key'] .. ']]'
		-- check [[:Κατηγορία:Φράσεις]]
		if data.level_1[cat_title]['extra1'] ~= '' and data.level_1[cat_title]['extra1'] ~= nil then
			cat = cat .. '[[Κατηγορία:' .. data.level_1[cat_title]['extra1'] .. '| ' .. data.level_1[cat_title]['key'] .. ']]' ..  "\n" -- sort top
		end			
	else
-- b1 Directly to their language. που υπάγονται ΑΠΕΥΘΕΙΑΣ στη γλώσσα τους e.g. [[:Κατηγορία:Γραμματικές κατηγορίες (αγγλικά)]]
		text = text_lang .. textit_lang 
			if cat_title == 'Αντίστροφο λεξικό' then
			text = text .. ' [[:Κατηγορία:Αντίστροφα λεξικά|«««]]'
			else
			text = text .. ' [[:Κατηγορία:' ..cat_title .. '|«««]]'
			end
		if data.level_1[cat_title]['extra0'] ~= '' and data.level_1[cat_title]['extra0'] ~= nil then
			text = text .. ' « [[:Κατηγορία:' .. data.level_1[cat_title]['extra0'] .. ' (' .. lang_name .. ')|' .. data.level_1[cat_title]['extra0'] .. ']]'
		end		
		-- check 
		if data.level_1[cat_title]['extra1'] ~= '' and data.level_1[cat_title]['extra1'] ~= nil then
			text = text .. ' « [[:Κατηγορία:' .. data.level_1[cat_title]['extra1'] .. ' (' .. lang_name .. ')|' .. data.level_1[cat_title]['extra1'] .. ']]'
		end		
		if languages[lang_iso].sublang == true then -- [[:Κατηγορία:Γραμματικές κατηγορίες (νεολατινικά)]]
		text = text .. '<dl><dd>« [[:Κατηγορία:' ..cat_title .. ' (' .. languages[lang_iso].host_name .. ')]]</dd></dl>'
		end

		-- descr
		if data.level_1[cat_title]['descr'] ~= '' and data.level_1[cat_title]['descr'] ~= nil then
			text_plus = '<dl><dd>' .. data.level_1[cat_title]['descr'] .. '</dd></dl>'
		end
			
		-- cat b -- ! check [[:Κατηγορία:Λήμματα με παραθέματα (ελληνιστική κοινή)]] (sublang + status=maim)
			-- [[:Κατηγορία:Λήμματα με παραθέματα (δωρική διάλεκτος)]] sublang NOT status main
		if languages[lang_iso].sublang == true then
			cat = '[[Κατηγορία:' .. cat_title .. ' (' .. languages[lang_iso].host_name .. ')|' .. languages[lang_iso].host_key .. ']]' ..  "\n"
			-- special top sortings: [[:Κατηγορία:Γραμματικές κατηγορίες (νεολατινικά)]]
			if cat_title == 'Γραμματικές κατηγορίες' or cat_title == 'Ετυμολογία' 
			or mw.ustring.find(cat_title, 'Πρότυπα')
			then
				cat = cat .. '[[Κατηγορία:' .. lang_cat .. '| ' .. data.level_1[cat_title]['key'] .. ']]' ..  "\n" -- sort top
			else
				cat = cat.. '[[Κατηγορία:' .. lang_cat .. '|' .. data.level_1[cat_title]['key'] .. ']]' ..  "\n" -- the rest are sorted by letter
			end
			-- check
			if data.level_1[cat_title]['extra1'] ~= '' and data.level_1[cat_title]['extra1'] ~= nil then
				cat = cat .. '[[Κατηγορία:' .. data.level_1[cat_title]['extra1']  .. ' (' .. lang_name .. ')| ' .. data.level_1[cat_title]['key'] .. ']]' ..  "\n" -- sort top
			end	
		else -- no sublang
			if cat_title == 'Αντίστροφο λεξικό' then
			cat = '[[Κατηγορία:Αντίστροφα λεξικά|' .. lang_key .. ']]' ..  "\n"
			else
			cat = '[[Κατηγορία:' .. cat_title .. '|' .. lang_key .. ']]' ..  "\n" -- DO I have to use than \n?????????	
			end
			-- special top sortings:
			if cat_title == 'Γραμματικές κατηγορίες' or cat_title == 'Ετυμολογία' 
			or mw.ustring.find(cat_title, 'Πρότυπα') then
				cat = cat .. '[[Κατηγορία:' .. lang_cat .. '| ' .. data.level_1[cat_title]['key'] .. ']]' ..  "\n" -- sort top
			else
				cat = cat .. '[[Κατηγορία:' .. lang_cat .. '|' .. data.level_1[cat_title]['key'] .. ']]' ..  "\n" -- the rest are sorted by letter
			end
			-- check
			if data.level_1[cat_title]['extra1'] ~= '' and data.level_1[cat_title]['extra1'] ~= nil then
				cat = cat .. '[[Κατηγορία:' .. data.level_1[cat_title]['extra1']  .. ' (' .. lang_name .. ')| ' .. data.level_1[cat_title]['key'] .. ']]' ..  "\n" -- sort top
			end	
		end -- close sublang
	end -- close cat_parenthesis
end -- close level_1
	
	
-- level_1bylang = ανά γλώσσα ============================= -- cf. και ΕΤΥΜΟΛΟΓΙΑ+apotin+ ρίζα, apota+ρίζες ανά γλώσσα
-- a1 specials:  + ανά γλώσσα by language -- [[:Κατηγορία:Θεματικές κατηγορίες]] [[:Κατηγορία:Υφολογικές κατηγορίες]]  [[:Κατηγορία:Πρότυπα βιβλιογραφίας]]
if data.level_1bylang[cat_title] then
	if cat_parenthesis == '' or cat_parenthesis == nil then
		text = text_wikt
		if data.level_1bylang[cat_title]['parent'] ~= '' and data.level_1bylang[cat_title]['parent'] ~= nil then
			if data.level_1bylang[cat_title]['parent_show'] ~= '' and data.level_1bylang[cat_title]['parent_show'] ~= nil then
			text = text .. ' » [[:Κατηγορία:' .. data.level_1bylang[cat_title]['parent'] .. '|' .. data.level_1bylang[cat_title]['parent_show'] .. ']]'
			else
			text = text .. ' » [[:Κατηγορία:' .. data.level_1bylang[cat_title]['parent'] .. '|' .. data.level_1bylang[cat_title]['parent'] .. ']]'
			end
		end
		text = text .. textit
		.. ' » [[:Κατηγορία:' .. cat_title .. ' ανά γλώσσα|ανά γλώσσα]]'
		
-- cat 1 (here, parent is rare) [[:Κατηγορία;Πρότυπα βιβλιογραφίας]]
		if data.level_1bylang[cat_title]['parent'] ~= '' and data.level_1bylang[cat_title]['parent'] ~= nil then
			cat = '[[Κατηγορία:' .. data.level_1bylang[cat_title]['parent'] .. '| ' .. data.level_1bylang[cat_title]['key'] .. ']]' ..  "\n" -- sort top
		else
			cat = '[[Κατηγορία:Βικιλεξικό|' .. data.level_1bylang[cat_title]['key'] .. ']]' ..  "\n"
		end
		
	else
-- b1 specials -- [[:Κατηγορία:Θεματικές κατηγορίες (αγγλικά)]] -- with parent [[:Κατηγορία:Πρότυπα βιβλιογραφίας (αγγλικά)]]
		text = text_lang
		if data.level_1bylang[cat_title]['parent'] ~= '' and data.level_1bylang[cat_title]['parent'] ~= nil then
			if data.level_1bylang[cat_title]['parent_show'] ~= '' and data.level_1bylang[cat_title]['parent_show'] ~= nil then
			text = text .. ' » [[:Κατηγορία:' .. data.level_1bylang[cat_title]['parent'] .. ' (' .. lang_name .. ')|' .. data.level_1bylang[cat_title]['parent_show'] .. ']]'
			else
			text = text .. ' » [[:Κατηγορία:' .. data.level_1bylang[cat_title]['parent'] .. ' (' .. lang_name .. ')|' .. data.level_1bylang[cat_title]['parent'] .. ']]'
			end
		end
		text = text .. textit_lang 
		.. ' « [[:Κατηγορία:' ..cat_title .. ' ανά γλώσσα|ανά γλώσσα]] « [[:Κατηγορία:' ..cat_title .. '|' ..cat_title .. ']]'
		-- check [[:Κατηγορία:Θεματικές κατηγορίες (τσακωνικά)]]
		if languages[lang_iso].sublang == true then
		text = text .. '<dl><dd>« [[:Κατηγορία:' ..cat_title .. ' (' .. languages[lang_iso].host_name .. ')]]</dd></dl>'
		end
			
	-- cat b
		cat = '[[Κατηγορία:' .. cat_title .. ' ανά γλώσσα|' .. lang_key .. ']]' ..  "\n"
		if data.level_1bylang[cat_title]['parent'] ~= '' and data.level_1bylang[cat_title]['parent'] ~= nil then
			if languages[lang_iso].sublang == true then
			cat = cat .. '[[Κατηγορία:' .. data.level_1bylang[cat_title]['parent'] .. ' (' .. languages[lang_iso].host_name .. ')|' .. data.level_1bylang[cat_title]['key'] .. ']]'
			else
			cat = cat .. '[[Κατηγορία:' .. data.level_1bylang[cat_title]['parent'] .. ' (' .. lang_name .. ')|' .. data.level_1bylang[cat_title]['key'] .. ']]'
			end
		end

		if languages[lang_iso].sublang == true then
			cat = cat .. '[[Κατηγορία:' .. cat_title .. ' (' .. languages[lang_iso].host_name .. ')|' .. languages[lang_iso].host_key .. ']]' ..  "\n"
			-- special sortings:
			if cat_title == 'Θεματικές κατηγορίες' or cat_title == 'Υφολογικές κατηγορίες' 
			or cat_title == 'Πρότυπα'
			then
				cat = cat .. '[[Κατηγορία:' .. lang_cat .. '| ' .. data.level_1bylang[cat_title]['key'] .. ']]' ..  "\n" -- sort top
			else
				cat = cat .. '[[Κατηγορία:' .. lang_cat .. '|' .. data.level_1bylang[cat_title]['key'] .. ']]' ..  "\n" -- the rest are sorted by letter
			end
		else
			if cat_title == 'Θεματικές κατηγορίες' or cat_title == 'Υφολογικές κατηγορίες' 
			or cat_title == 'Πρότυπα'
			then
				cat = cat .. '[[Κατηγορία:' .. lang_cat .. '| ' .. data.level_1bylang[cat_title]['key'] .. ']]' ..  "\n" -- sort top
			else
				cat = cat .. '[[Κατηγορία:' .. lang_cat .. '|' .. data.level_1bylang[cat_title]['key'] .. ']]' ..  "\n" -- sort normal
			end
	
		end -- close sublang
	end -- close cat_parenthesis
end -- close level_1bylang

-- a1 Τίτλος: ανά γλώσσα. This occurs only in mode a -- [[:Κατηγορία:Θεματικές κατηγορίες ανά γλώσσα]] for level_1bylang, the second phrase:
	-- with parent [[:Κατηγορία:Πρότυπα βιβλιογραφίας ανά γλώσσα]]
if mw.ustring.find(cat_title, 'ανά γλώσσα') and not mw.ustring.find(cat_title, 'ρίζες') then
	cat_title = mw.ustring.sub(mw.ustring.match(cat_title, cat_title), 1, -12) -- take off 'ανά γλώσσα'
	text = text_wikt
		if data.level_1bylang[cat_title]['parent'] ~= '' and data.level_1bylang[cat_title]['parent'] ~= nil then
			if data.level_1bylang[cat_title]['parent_show'] ~= '' and data.level_1bylang[cat_title]['parent_show'] ~= nil then
			text = text .. ' » [[:Κατηγορία:' .. data.level_1bylang[cat_title]['parent'] .. '|' .. data.level_1bylang[cat_title]['parent_show'] .. ']]'
			else
			text = text .. ' » [[:Κατηγορία:' .. data.level_1bylang[cat_title]['parent'] .. '|' .. data.level_1bylang[cat_title]['parent'] .. ']]'
			end
		end
	text = text
	.. ' » [[:Κατηγορία:' .. cat_title .. '|' .. cat_title .. ']]'
	.. ' » [[:Κατηγορία:' .. cat_title .. ' ανά γλώσσα|ανά γλώσσα]]'

	cat = '[[Κατηγορία:' .. cat_title .. '| ]]' .. "\n" -- sort top
--		.. '[[Κατηγορία:Βικιλεξικό|' .. cat_title .. '|' .. data.level_1bylang[cat_title]['key'] .. ']]' .. "\n"
end


--------------------------------------------------------------------------
--                      general DATA LABEL                              --
-- at [[Module:auto cat/data]] -- always call them with data.label
--------------------------------------------------------------------------

--  e.g. [[:Κατηγορία:Ανορθογραφίες]] [[:Κατηγορία:Δανεισμοί]]
if data.label[cat_title] then

-- a mode, no (language)
	if cat_parenthesis == '' or cat_parenthesis == nil then
		text = text_wikt
		if data.label[cat_title]['parent6'] ~= '' and data.label[cat_title]['parent6'] ~= nil then
			text = text .. ' » [[:Κατηγορία:' .. data.label[cat_title]['parent6'] .. '|' .. data.label[cat_title]['parent6'] .. ']]'
		end	
		if data.label[cat_title]['parent5'] ~= '' and data.label[cat_title]['parent5'] ~= nil then
			text = text .. ' » [[:Κατηγορία:' .. data.label[cat_title]['parent5'] .. '|' .. data.label[cat_title]['parent5'] .. ']]'
		end	
		if data.label[cat_title]['parent4'] ~= '' and data.label[cat_title]['parent4'] ~= nil then
			if data.label[cat_title]['parent4_show'] ~= '' and data.label[cat_title]['parent4_show'] ~= nil then
			text = text .. ' » [[:Κατηγορία:' .. data.label[cat_title]['parent4'] .. '|' .. data.label[cat_title]['parent4_show'] .. ']]'
			else
			text = text .. ' » [[:Κατηγορία:' .. data.label[cat_title]['parent4'] .. '|' .. data.label[cat_title]['parent4'] .. ']]'
			end
		end	
		if data.label[cat_title]['parent3'] ~= '' and data.label[cat_title]['parent3'] ~= nil then
			if data.label[cat_title]['parent3_show'] ~= '' and data.label[cat_title]['parent3_show'] ~= nil then
			text = text .. ' » [[:Κατηγορία:' .. data.label[cat_title]['parent3'] .. '|' .. data.label[cat_title]['parent3_show'] .. ']]'
			else
			text = text .. ' » [[:Κατηγορία:' .. data.label[cat_title]['parent3'] .. '|' .. data.label[cat_title]['parent3'] .. ']]'
			end
		end
		if data.label[cat_title]['parent2'] ~= '' and data.label[cat_title]['parent2'] ~= nil then
			if data.label[cat_title]['parent2_show'] ~= '' and data.label[cat_title]['parent2_show'] ~= nil then
			text = text .. ' » [[:Κατηγορία:' .. data.label[cat_title]['parent2'] .. '|' .. data.label[cat_title]['parent2_show'] .. ']]'
			else
			text = text .. ' » [[:Κατηγορία:' .. data.label[cat_title]['parent2'] .. '|' .. data.label[cat_title]['parent2'] .. ']]'
			end
		end
	-- they all have parent: [[:Κατηγορία:Δάνεια - ονόματα]]
		if data.label[cat_title]['parent'] ~= '' and data.label[cat_title]['parent'] ~= nil then
			if data.label[cat_title]['parent_show'] ~= '' and data.label[cat_title]['parent_show'] ~= nil then
			text = text .. ' » [[:Κατηγορία:' .. data.label[cat_title]['parent'] .. '|' .. data.label[cat_title]['parent_show'] .. ']]'
			else
			text = text .. ' » [[:Κατηγορία:' .. data.label[cat_title]['parent'] .. '|' .. data.label[cat_title]['parent'] .. ']]'
			end
		end
		if data.label[cat_title]['show'] ~= '' and data.label[cat_title]['show'] ~= nil then
			text =  text .. ' » [[:Κατηγορία:' .. cat_title .. '|' .. data.label[cat_title]['show'] .. ']]'
		else
			text = text .. textit
		end
		-- extra0 ONLY in text, not at categories
		if data.label[cat_title]['extra0'] ~= '' and data.label[cat_title]['extra0'] ~= nil then
			if data.label[cat_title]['extra0_show'] ~= '' and data.label[cat_title]['extra0_show'] ~= nil then
			text = text .. ' « [[:Κατηγορία:' .. data.label[cat_title]['extra0'] .. '|' .. data.label[cat_title]['extra0_show'] .. ']]'
			else
			text = text .. ' « [[:Κατηγορία:' .. data.label[cat_title]['extra0'] .. '|' .. data.label[cat_title]['extra0'] .. ']]'
			end
		end	
		if data.label[cat_title]['extra1'] ~= '' and data.label[cat_title]['extra1'] ~= nil then
			if data.label[cat_title]['extra1_show'] ~= '' and data.label[cat_title]['extra1_show'] ~= nil then
			text = text .. ' « [[:Κατηγορία:' .. data.label[cat_title]['extra1'] .. '|' .. data.label[cat_title]['extra1_show'] .. ']]'
			else
			text = text .. ' « [[:Κατηγορία:' .. data.label[cat_title]['extra1'] .. '|' .. data.label[cat_title]['extra1'] .. ']]' -- [[:Κατηγορία:Αμάρτυροι τύποι]]
			end
		end
		-- descr -- [[:Κατηγορία:Λέξεις με άγνωστη ετυμολογία]]
		if data.label[cat_title]['descr'] ~= '' and data.label[cat_title]['descr'] ~= nil then
			text_plus = '<dl><dd>' .. data.label[cat_title]['descr'] .. '</dd></dl>'
		end
--		if cat_title == 'Δανεισμοί' then
--			text_plus =  "\n" .. frame:expandTemplate{ title = 'δείτε', args = {':Κατηγορία:Προέλευση λέξεων'} } .. "\n"
--		end
--		if cat_title == 'Προέλευση λέξεων' then
--			text_plus =  "\n" .. frame:expandTemplate{ title = 'δείτε', args = {':Κατηγορία:Δανεισμοί'} } .. "\n"
--			.. descr_der
--		end
	
		-- cat a -- MUST have parent		
		cat = '[[Κατηγορία:' .. data.label[cat_title]['parent'] .. '| ' .. data.label[cat_title]['key'] .. ']]' ..  "\n" -- sort top
		if data.label[cat_title]['extra1'] ~= '' and data.label[cat_title]['extra1'] ~= nil then
			cat = cat .. '[[Κατηγορία:' .. data.label[cat_title]['extra1'] .. '| ' .. data.label[cat_title]['key'] .. ']]' ..  "\n" -- sort top
		end
		if data.label[cat_title]['extra2'] ~= '' and data.label[cat_title]['extra2'] ~= nil then
			cat = cat .. '[[Κατηγορία:' .. data.label[cat_title]['extra2'] .. '| ' .. data.label[cat_title]['key'] .. ']]' ..  "\n" -- sort top
		end
		if data.label[cat_title]['extra3'] ~= '' and data.label[cat_title]['extra3'] ~= nil then
			cat = cat .. '[[Κατηγορία:' .. data.label[cat_title]['extra3'] .. '| ' .. data.label[cat_title]['key'] .. ']]' ..  "\n" -- sort top
		end
		
	else
-- b mode e.g. [[:Κατηγορία:Ανορθογραφίες (νέα ελληνικά)]]  -- [[:Κατηγορία:Αμάρτυροι τύποι (αρχαία ελληνικά)]]
		text = text_lang
		if data.label[cat_title]['parent6'] ~= '' and data.label[cat_title]['parent6'] ~= nil then
			text = text .. ' » [[:Κατηγορία:' .. data.label[cat_title]['parent6'] .. ' (' .. lang_name .. ')|' .. data.label[cat_title]['parent6'] .. ']]'
		end	
		if data.label[cat_title]['parent5'] ~= '' and data.label[cat_title]['parent5'] ~= nil then
			text = text .. ' » [[:Κατηγορία:' .. data.label[cat_title]['parent5'] .. ' (' .. lang_name .. ')|' .. data.label[cat_title]['parent5'] .. ']]'
		end
		if data.label[cat_title]['parent4'] ~= '' and data.label[cat_title]['parent4'] ~= nil then
			if data.label[cat_title]['parent4_show'] ~= '' and data.label[cat_title]['parent4_show'] ~= nil then
			text = text .. ' » [[:Κατηγορία:' .. data.label[cat_title]['parent4'] .. ' (' .. lang_name .. ')|' .. data.label[cat_title]['parent4_show'] .. ']]'
			else
			text = text .. ' » [[:Κατηγορία:' .. data.label[cat_title]['parent4'] .. ' (' .. lang_name .. ')|' .. data.label[cat_title]['parent4'] .. ']]'
			end
		end	
		if data.label[cat_title]['parent3'] ~= '' and data.label[cat_title]['parent3'] ~= nil then
			if data.label[cat_title]['parent3_show'] ~= '' and data.label[cat_title]['parent3_show'] ~= nil then
			text = text .. ' » [[:Κατηγορία:' .. data.label[cat_title]['parent3'] .. ' (' .. lang_name .. ')|' .. data.label[cat_title]['parent3_show'] .. ']]'
			else
			text = text .. ' » [[:Κατηγορία:' .. data.label[cat_title]['parent3'] .. ' (' .. lang_name .. ')|' .. data.label[cat_title]['parent3'] .. ']]'
			end
		end	
		if data.label[cat_title]['parent2'] ~= '' and data.label[cat_title]['parent2'] ~= nil then
			if data.label[cat_title]['parent2_show'] ~= '' and data.label[cat_title]['parent2_show'] ~= nil then
			text = text .. ' » [[:Κατηγορία:' .. data.label[cat_title]['parent2'] .. ' (' .. lang_name .. ')|' .. data.label[cat_title]['parent2_show'] .. ']]'
			else
			text = text .. ' » [[:Κατηγορία:' .. data.label[cat_title]['parent2'] .. ' (' .. lang_name .. ')|' .. data.label[cat_title]['parent2'] .. ']]'
			end
		end	
		-- they all have parent [[:Κατηγορία:Δάνεια - ονόματα (αρχαία ελληνικά)]], except if -
		if data.label[cat_title]['parent'] ~= '' and data.label[cat_title]['parent'] ~= nil and data.label[cat_title]['parent'] ~= '-' then
			if data.label[cat_title]['parent_show'] ~= '' and data.label[cat_title]['parent_show'] ~= nil then
			text = text .. ' » [[:Κατηγορία:' .. data.label[cat_title]['parent'] .. ' (' .. lang_name .. ')|' .. data.label[cat_title]['parent_show'] .. ']]'
			else
			text = text .. ' » [[:Κατηγορία:' .. data.label[cat_title]['parent'] .. ' (' .. lang_name .. ')|' .. data.label[cat_title]['parent'] .. ']]'
			end
--!!!		-- except language specifics e.g. [[:Κατηγορία:Δημοτική (νέα ελληνικά)]] - parent: [[:Κατηγορία:Ποικιλίες της νεοελληνικής γλώσσας]] PARENT = el
		elseif data.label[cat_title]['parent'] == '-' then
			text = text 
		end
		if data.label[cat_title]['show'] ~= '' and data.label[cat_title]['show'] ~= nil then
			text = text .. ' » [[:Κατηγορία:' .. cat_title .. ' (' .. lang_name .. ')|' .. data.label[cat_title]['show'] .. ']]'
		else
			text =  text .. textit_lang
		end
		-- last part  <<<

				-- EXCEPTION 	[[:Κατηγορία:Ρήματα στην παθητική φωνή (νέα ελληνικά)]]
				if data.label[cat_title]['show'] == 'στην παθητική φωνή'
				or data.label[cat_title]['show'] == 'στη μεσοπαθητική φωνή'
				then
				text = text .. ' [[:Κατηγορία:Ρήματα στην παθητική ή μεσοπαθητική φωνή|«««]]'	
				else
			
		-- link ONLY to this language with param |γλ=1 |lang=1
		if lang_specific ~= '' and lang_specific ~= nil then
			text = text
		else

			text = text .. ' [[:Κατηγορία:' .. cat_title .. '|«««]]'
		end
				end -- close Ρήματα
				
		-- extra0 ONLY in text, not at categories
		if data.label[cat_title]['extra0'] ~= '' and data.label[cat_title]['extra0'] ~= nil then
			if data.label[cat_title]['extra0_show'] ~= '' and data.label[cat_title]['extra0_show'] ~= nil then
			text = text .. ' « [[:Κατηγορία:' .. data.label[cat_title]['extra0'] .. ' (' .. lang_name .. ')|' .. data.label[cat_title]['extra0_show'] .. ']]'
			else -- [[:Κατηγορία:Αμάρτυροι τύποι (αρχαία ελληνικά)]]
			text = text .. ' « [[:Κατηγορία:' .. data.label[cat_title]['extra0'] .. ' (' .. lang_name .. ')|' .. data.label[cat_title]['extra0'] .. ']]'
			end
		end		
		if data.label[cat_title]['extra1'] ~= '' and data.label[cat_title]['extra1'] ~= nil then
				-- EXCEPTION: DO NOT ACCEPT extras (extra1) for language families at Κατηγορία: 'ως προς την καταγωγή'
				-- e.g. [[Κατηγορία:Επώνυμα ως προς την καταγωγή (σλαβικές γλώσσες)]]
				if mw.ustring.find(cat_title, 'ως προς την καταγωγή') and languages[lang_iso].family == true then
				text = text 	
				else
			if data.label[cat_title]['extra1_show'] ~= '' and data.label[cat_title]['extra1_show'] ~= nil then
			text = text .. ' « [[:Κατηγορία:' .. data.label[cat_title]['extra1'] .. ' (' .. lang_name .. ')|' .. data.label[cat_title]['extra1_show'] .. ']]'
			else -- [[:Κατηγορία:Αμάρτυροι τύποι (αρχαία ελληνικά)]]
			text = text .. ' « [[:Κατηγορία:' .. data.label[cat_title]['extra1'] .. ' (' .. lang_name .. ')|' .. data.label[cat_title]['extra1'] .. ']]'
			end
				end -- close language families
		end	
	-- check [[:Κατηγορία:Μετοχές (ελληνιστική κοινή)]] + it has extra
		if languages[lang_iso].sublang == true then
			text = text .. ' <dl><dd>« [[:Κατηγορία:' .. cat_title .. ' (' .. languages[lang_iso].host_name .. ')]]</dd></dl>'
		end	
		-- descr -- [[:Κατηγορία:Λέξεις με άγνωστη ετυμολογία (νέα ελληνικά)]]
		if data.label[cat_title]['descr'] ~= '' and data.label[cat_title]['descr'] ~= nil then
			text_plus = '<dl><dd>' .. data.label[cat_title]['descr'] .. '</dd></dl>'
		end
--		if cat_title == 'Δανεισμοί' then
--			text_plus =  "\n" .. frame:expandTemplate{ title = 'δείτε', args = {':Κατηγορία:Προέλευση λέξεων (' .. lang_name .. ')'} } .. "\n"
--		end
--		if cat_title == 'Προέλευση λέξεων' then
--			text_plus =  "\n" .. frame:expandTemplate{ title = 'δείτε', args = {':Κατηγορία:Δανεισμοί (' .. lang_name .. ')'} } .. "\n"
--			.. descr_der
--		end
	
		-- cat b -- MUST have parent	 -- e.g. [[:Κατηγορία:Δανεισμοί (ελληνιστική κοινή)]]
		if languages[lang_iso].sublang == true then
			cat = '[[Κατηγορία:' .. cat_title .. ' (' .. languages[lang_iso].host_name .. ')|' .. languages[lang_iso].host_key .. ']]' ..  "\n"
			.. '[[Κατηγορία:' .. data.label[cat_title]['parent'] .. ' (' .. lang_name .. ')|' .. data.label[cat_title]['key'] .. ']]'
		else
--!!!		-- except language specifics e.g. [[:Κατηγορία:Δημοτική (νέα ελληνικά)]] - parent: [[:Κατηγορία:Ποικιλίες της νεοελληνικής γλώσσας]] PARENT = el
			if data.label[cat_title]['parent'] == '-' then
				cat = '[[Κατηγορία:' .. lang_cat .. '|' .. data.label[cat_title]['key'] .. ']]'
			elseif lang_specific ~= '' and lang_specific ~= nil and data.label[cat_title]['parent'] ~= '-'  then
				cat = '[[Κατηγορία:' .. data.label[cat_title]['parent'] .. ' (' .. lang_name .. ')|' .. data.label[cat_title]['key'] .. ']]'
		
				-- EXCEPTION 	[[:Κατηγορία:Ρήματα στην παθητική φωνή (νέα ελληνικά)]]
			elseif data.label[cat_title]['show'] == 'στην παθητική φωνή'
				or data.label[cat_title]['show'] == 'στη μεσοπαθητική φωνή'
				then
				cat = '[[Κατηγορία:Ρήματα στην παθητική ή μεσοπαθητική φωνή|' .. lang_key .. ']]' ..  "\n"
				.. '[[Κατηγορία:' .. data.label[cat_title]['parent'] .. ' (' .. lang_name .. ')|' .. data.label[cat_title]['key'] .. ']]'
			else
			cat = '[[Κατηγορία:' .. cat_title .. '|' .. lang_key .. ']]' ..  "\n"
			.. '[[Κατηγορία:' .. data.label[cat_title]['parent'] .. ' (' .. lang_name .. ')|' .. data.label[cat_title]['key'] .. ']]'
			end
		end -- close hosted languages

		if data.label[cat_title]['extra1'] ~= '' and data.label[cat_title]['extra1'] ~= nil then
				-- EXCEPTION: DO NOT ACCEPT extras (extra1) for language families at Κατηγορία: 'ως προς την καταγωγή'
				-- e.g. [[Κατηγορία:Επώνυμα ως προς την καταγωγή (σλαβικές γλώσσες)]]
				if mw.ustring.find(cat_title, 'ως προς την καταγωγή') and languages[lang_iso].family == true then
				cat = cat 	
				else		
			cat = cat .. '[[Κατηγορία:' .. data.label[cat_title]['extra1'] .. ' (' .. lang_name .. ')|' .. data.label[cat_title]['key'] .. ']]' ..  "\n"
				end -- close families
		end
		if data.label[cat_title]['extra2'] ~= '' and data.label[cat_title]['extra2'] ~= nil then
			cat = cat .. '[[Κατηγορία:' .. data.label[cat_title]['extra2'] .. ' (' .. lang_name .. ')|' .. data.label[cat_title]['key'] .. ']]' ..  "\n"
		end	
		if data.label[cat_title]['extra3'] ~= '' and data.label[cat_title]['extra3'] ~= nil then
			cat = cat .. '[[Κατηγορία:' .. data.label[cat_title]['extra3'] .. ' (' .. lang_name .. ')|' .. data.label[cat_title]['key'] .. ']]' ..  "\n"
		end	
	end -- close cat_parenthesis
end -- close level_2



--------------------------------------------------------------------------
--    ΘΕΜΑΤΙΚΗ ΟΡΟΛΟΓΙΑ εκτός τόπων - TOPICS LABEL  excpet placenames    --
-- at [[Module:auto cat/data/topics]] -- always call them with topics.label
-- correspond to [[Module:labels/data]]
--------------------------------------------------------------------------
-- ## + more parents if needed
--  e.g. [[:Category:HTML]] [[:Κατηγορία:Αεροπορικοί όροι]]
if topics.label[cat_title] then

-- a mode, no (language)
	if cat_parenthesis == '' or cat_parenthesis == nil then
		text = text_wikt
		if topics.label[cat_title]['parent4'] ~= '' and topics.label[cat_title]['parent4'] ~= nil then
			text = text .. ' » [[:Κατηγορία:' .. topics.label[cat_title]['parent4'] .. '|' .. topics.label[cat_title]['parent4'] .. ']]'
		end	
		if topics.label[cat_title]['parent3'] ~= '' and topics.label[cat_title]['parent3'] ~= nil then
			text = text .. ' » [[:Κατηγορία:' .. topics.label[cat_title]['parent3'] .. '|' .. topics.label[cat_title]['parent3'] .. ']]'
		end
		if topics.label[cat_title]['parent2'] ~= '' and topics.label[cat_title]['parent2'] ~= nil then
			if topics.label[cat_title]['parent2_show'] ~= '' and topics.label[cat_title]['parent2_show'] ~= nil then
			text = text .. ' » [[:Κατηγορία:' .. topics.label[cat_title]['parent2'] .. '|' .. topics.label[cat_title]['parent2_show'] .. ']]'
			else
			text = text .. ' » [[:Κατηγορία:' .. topics.label[cat_title]['parent2'] .. '|' .. topics.label[cat_title]['parent2'] .. ']]'
			end
		end
-- they all have parent
		if topics.label[cat_title]['parent'] ~= '' and topics.label[cat_title]['parent'] ~= nil then
			if topics.label[cat_title]['parent_show'] ~= '' and topics.label[cat_title]['parent_show'] ~= nil then
			text = text .. ' » [[:Κατηγορία:' .. topics.label[cat_title]['parent'] .. '|' .. topics.label[cat_title]['parent_show'] .. ']]'
			else
			text = text .. ' » [[:Κατηγορία:' .. topics.label[cat_title]['parent'] .. '|' .. topics.label[cat_title]['parent'] .. ']]'
			end
		end
		if topics.label[cat_title]['show'] ~= '' and topics.label[cat_title]['show'] ~= nil then
			text =  text .. ' » [[:Κατηγορία:' .. cat_title .. '|' .. topics.label[cat_title]['show'] .. ']]'
		else
			text = text .. textit
		end
		-- extra0 ONLY in text, not at categories e.g. [[:Κατηγορία:Υφάσματα]] & [[:Κατηγορία:Ενδυμασία]]
		if topics.label[cat_title]['extra0'] ~= '' and topics.label[cat_title]['extra0'] ~= nil then
			if topics.label[cat_title]['extra0_show'] ~= '' and topics.label[cat_title]['extra0_show'] ~= nil then
			text = text .. ' « [[:Κατηγορία:' .. topics.label[cat_title]['extra0'] .. '|' .. topics.label[cat_title]['extra0_show'] .. ']]'
			else
			text = text .. ' « [[:Κατηγορία:' .. topics.label[cat_title]['extra0'] .. '|' .. topics.label[cat_title]['extra0'] .. ']]'
			end
		end
		if topics.label[cat_title]['extra1'] ~= '' and topics.label[cat_title]['extra1'] ~= nil then
			if topics.label[cat_title]['extra1_show'] ~= '' and topics.label[cat_title]['extra1_show'] ~= nil then
			text = text .. ' « [[:Κατηγορία:' .. topics.label[cat_title]['extra1'] .. '|' .. topics.label[cat_title]['extra1_show'] .. ']]'
			else  -- [[:Κατηγορία:Αμάρτυροι τύποι]]
			text = text .. ' « [[:Κατηγορία:' .. topics.label[cat_title]['extra1'] .. '|' .. topics.label[cat_title]['extra1'] .. ']]'
			end
		end
		-- descr
		if topics.label[cat_title]['descr'] ~= '' and topics.label[cat_title]['descr'] ~= nil then
			text_plus = '<dl><dd>' .. topics.label[cat_title]['descr'] .. '</dd></dl>'
		end

		-- cat a	-- MUST have parent		
		cat = '[[Κατηγορία:' .. topics.label[cat_title]['parent'] .. '| ' .. topics.label[cat_title]['key'] .. ']]' ..  "\n" -- sort top
		if topics.label[cat_title]['extra1'] ~= '' and topics.label[cat_title]['extra1'] ~= nil then
			cat = cat .. '[[Κατηγορία:' .. topics.label[cat_title]['extra1'] .. '| ' .. topics.label[cat_title]['key'] .. ']]' ..  "\n" -- sort top
		end
		-- ALWAYS PUT AT [[:Κατηγορία:Θεματικές κατηγορίες]] nomatter what
		cat = cat .. '[[Κατηγορία:Θεματικές κατηγορίες|' .. topics.label[cat_title]['key'] .. ']]' ..  "\n" 
		if topics.label[cat_title]['extra2'] ~= '' and topics.label[cat_title]['extra2'] ~= nil then
			cat = cat .. '[[Κατηγορία:' .. topics.label[cat_title]['extra2'] .. '| ' .. topics.label[cat_title]['key'] .. ']]' ..  "\n" -- sort top
		end
		if topics.label[cat_title]['extra3'] ~= '' and topics.label[cat_title]['extra3'] ~= nil then
			cat = cat .. '[[Κατηγορία:' .. topics.label[cat_title]['extra3'] .. '| ' .. topics.label[cat_title]['key'] .. ']]' ..  "\n" -- sort top
		end
	
	else
-- b mode 
		text = text_lang
		if topics.label[cat_title]['parent4'] ~= '' and topics.label[cat_title]['parent4'] ~= nil then
			text = text .. ' » [[:Κατηγορία:' .. topics.label[cat_title]['parent4'] .. ' (' .. lang_name .. ')|' .. topics.label[cat_title]['parent4'] .. ']]'
		end	
		if topics.label[cat_title]['parent3'] ~= '' and topics.label[cat_title]['parent3'] ~= nil then
			text = text .. ' » [[:Κατηγορία:' .. topics.label[cat_title]['parent3'] .. ' (' .. lang_name .. ')|' .. topics.label[cat_title]['parent3'] .. ']]'
		end	
		if topics.label[cat_title]['parent2'] ~= '' and topics.label[cat_title]['parent2'] ~= nil then
			if topics.label[cat_title]['parent2_show'] ~= '' and topics.label[cat_title]['parent2_show'] ~= nil then
			text = text .. ' » [[:Κατηγορία:' .. topics.label[cat_title]['parent2'] .. ' (' .. lang_name .. ')|' .. topics.label[cat_title]['parent2_show'] .. ']]'
			else
			text = text .. ' » [[:Κατηγορία:' .. topics.label[cat_title]['parent2'] .. ' (' .. lang_name .. ')|' .. topics.label[cat_title]['parent2'] .. ']]'
			end
		end	
	
		if topics.label[cat_title]['parent'] ~= '' and topics.label[cat_title]['parent'] ~= nil then
			if topics.label[cat_title]['parent_show'] ~= '' and topics.label[cat_title]['parent_show'] ~= nil then
			text = text .. ' » [[:Κατηγορία:' .. topics.label[cat_title]['parent'] .. ' (' .. lang_name .. ')|' .. topics.label[cat_title]['parent_show'] .. ']]'
			else
			text = text .. ' » [[:Κατηγορία:' .. topics.label[cat_title]['parent'] .. ' (' .. lang_name .. ')|' .. topics.label[cat_title]['parent'] .. ']]'
			end
		end
		if topics.label[cat_title]['show'] ~= '' and topics.label[cat_title]['show'] ~= nil then
			text = text .. ' » [[:Κατηγορία:' .. cat_title .. ' (' .. lang_name .. ')|' .. topics.label[cat_title]['show'] .. ']]'
			-- link ONLY to this language with param |γλ=1 |lang=1 [[:Κατηγορία:Χαρακτήρες κάντζι (ιαπωνικά)]]
			if lang_specific ~= '' and lang_specific ~= nil then
			text = text
			else
			text = text .. ' [[:Κατηγορία:' .. cat_title .. '|«««]]'
			end
		else
			text =  text .. textit_lang
			-- link ONLY to this language with param |γλ=1 |lang=1 [[:Κατηγορία:Χαρακτήρες κάντζι (ιαπωνικά)]]
			if lang_specific ~= '' and lang_specific ~= nil then
			text = text
			else
			text = text .. ' [[:Κατηγορία:' .. cat_title .. '|«««]]'
			end
		end

		-- extra0 ONLY in text, not at categories e.g. [[:Κατηγορία:Υφάσματα (νέα ελληνικά)]] & [[:Κατηγορία:Ενδυμασία (νέα ελληνικά)]]
		if topics.label[cat_title]['extra0'] ~= '' and topics.label[cat_title]['extra0'] ~= nil then
			if topics.label[cat_title]['extra0_show'] ~= '' and topics.label[cat_title]['extra0_show'] ~= nil then
			text = text .. ' « [[:Κατηγορία:' .. topics.label[cat_title]['extra0'] .. ' (' .. lang_name .. ')|' .. topics.label[cat_title]['extra0_show'] .. ']]'
			else
			text = text .. ' « [[:Κατηγορία:' .. topics.label[cat_title]['extra0'] .. ' (' .. lang_name .. ')|' .. topics.label[cat_title]['extra0'] .. ']]'
			end
		end	
		if topics.label[cat_title]['extra1'] ~= '' and topics.label[cat_title]['extra1'] ~= nil then
			if topics.label[cat_title]['extra1_show'] ~= '' and topics.label[cat_title]['extra1_show'] ~= nil then
			text = text .. ' « [[:Κατηγορία:' .. topics.label[cat_title]['extra1'] .. ' (' .. lang_name .. ')|' .. topics.label[cat_title]['extra1_show'] .. ']]'
			else   -- [[:Κατηγορία:Αμάρτυροι τύποι (αρχαία ελληνικά)]]
			text = text .. ' « [[:Κατηγορία:' .. topics.label[cat_title]['extra1'] .. ' (' .. lang_name .. ')|' .. topics.label[cat_title]['extra1'] .. ']]'
			end
		end
		-- check [[:Κατηγορία:Ανατομία (ελληνιστική κοινή)]]
		if languages[lang_iso].sublang == true then
			text = text .. ' <dl><dd>« [[:Κατηγορία:' .. cat_title .. ' (' .. languages[lang_iso].host_name .. ')]]</dd></dl>'
		end	
		-- descr
		if topics.label[cat_title]['descr'] ~= '' and topics.label[cat_title]['descr'] ~= nil then
			text_plus = '<dl><dd>' .. topics.label[cat_title]['descr'] .. '</dd></dl>'
		end

		-- cat b	-- MUST have parent
		if languages[lang_iso].sublang == true then
			cat = '[[Κατηγορία:' .. cat_title .. ' (' .. languages[lang_iso].host_name .. ')|' .. languages[lang_iso].host_key .. ']]' ..  "\n"
			.. '[[Κατηγορία:' .. topics.label[cat_title]['parent'] .. ' (' .. lang_name .. ')|' .. topics.label[cat_title]['key'] .. ']]' ..  "\n"
		else
		-- link ONLY to this language with param |γλ=1 |lang=1 [[:Κατηγορία:Χαρακτήρες κάντζι (ιαπωνικά)]] 
			if lang_specific ~= '' and lang_specific ~= nil then
			cat = '[[Κατηγορία:' .. topics.label[cat_title]['parent'] .. ' (' .. lang_name .. ')|' .. topics.label[cat_title]['key'] .. ']]'
			else
			cat = '[[Κατηγορία:' .. cat_title .. '|' .. lang_key .. ']]' ..  "\n"
			.. '[[Κατηγορία:' .. topics.label[cat_title]['parent'] .. ' (' .. lang_name .. ')|' .. topics.label[cat_title]['key'] .. ']]' -- ??srt -- normal
			end
		end -- close hosted languages
		-- ALWAYS PUT AT  Κατηγορία:Θεματικές κατηγορίες (language) nomatter what
		cat = cat .. '[[Κατηγορία:Θεματικές κατηγορίες (' .. lang_name .. ')|' .. topics.label[cat_title]['key'] .. ']]' ..  "\n"
		if topics.label[cat_title]['extra1'] ~= '' and topics.label[cat_title]['extra1'] ~= nil then
			cat = cat .. '[[Κατηγορία:' .. topics.label[cat_title]['extra1'] .. ' (' .. lang_name .. ')|' .. topics.label[cat_title]['key'] .. ']]' ..  "\n"
		end
		if topics.label[cat_title]['extra2'] ~= '' and topics.label[cat_title]['extra2'] ~= nil then
			cat = cat .. '[[Κατηγορία:' .. topics.label[cat_title]['extra2'] .. ' (' .. lang_name .. ')|' .. topics.label[cat_title]['key'] .. ']]' ..  "\n"
		end	
		if topics.label[cat_title]['extra3'] ~= '' and topics.label[cat_title]['extra3'] ~= nil then
			cat = cat .. '[[Κατηγορία:' .. topics.label[cat_title]['extra3'] .. ' (' .. lang_name .. ')|' .. topics.label[cat_title]['key'] .. ']]' ..  "\n"
		end	
	end -- close cat_parenthesis
end -- close TOPICS




--------------------------------------------------------------------------
--                       ΥΦΟΛΟΓΙΚΕΣ - STYLE                          --
-- at [[Module:auto cat/data/style]] -- always call them with style.label
-- correspond to [[Module:labels/data]]
-- [[:Κατηγορία:Υφολογικές κατηγορίες]] - [[:Κατηγορία:Υφολογικές κατηγορίες ανά γλώσσα]]
--------------------------------------------------------------------------
-- ##+ more parents if needed
--  e.g. [[:Κατηγορία:Αργκό]]
if style.label[cat_title] then

-- a mode, no (language)
	if cat_parenthesis == '' or cat_parenthesis == nil then
		text = text_wikt
		if style.label[cat_title]['parent4'] ~= '' and style.label[cat_title]['parent4'] ~= nil then
			text = text .. ' » [[:Κατηγορία:' .. style.label[cat_title]['parent4'] .. '|' .. style.label[cat_title]['parent4'] .. ']]'
		end	
		if style.label[cat_title]['parent3'] ~= '' and style.label[cat_title]['parent3'] ~= nil then
			text = text .. ' » [[:Κατηγορία:' .. style.label[cat_title]['parent3'] .. '|' .. style.label[cat_title]['parent3'] .. ']]'
		end
		if style.label[cat_title]['parent2'] ~= '' and style.label[cat_title]['parent2'] ~= nil then
			if style.label[cat_title]['parent2_show'] ~= '' and style.label[cat_title]['parent2_show'] ~= nil then
			text = text .. ' » [[:Κατηγορία:' .. style.label[cat_title]['parent2'] .. '|' .. style.label[cat_title]['parent2_show'] .. ']]'
			else
			text = text .. ' » [[:Κατηγορία:' .. style.label[cat_title]['parent2'] .. '|' .. style.label[cat_title]['parent2'] .. ']]'
			end
		end
	-- they all have parent
		if style.label[cat_title]['parent'] ~= '' and style.label[cat_title]['parent'] ~= nil then
			if style.label[cat_title]['parent_show'] ~= '' and style.label[cat_title]['parent_show'] ~= nil then
			text = text .. ' » [[:Κατηγορία:' .. style.label[cat_title]['parent'] .. '|' .. style.label[cat_title]['parent_show'] .. ']]'
			else
			text = text .. ' » [[:Κατηγορία:' .. style.label[cat_title]['parent'] .. '|' .. style.label[cat_title]['parent'] .. ']]'
			end
		end
		if style.label[cat_title]['show'] ~= '' and style.label[cat_title]['show'] ~= nil then
			text =  text .. ' » [[:Κατηγορία:' .. cat_title .. '|' .. style.label[cat_title]['show'] .. ']]'
		else
			text = text .. textit
		end
		-- extra0 ONLY in text, not at categories
		if style.label[cat_title]['extra0'] ~= '' and style.label[cat_title]['extra0'] ~= nil then
			if style.label[cat_title]['extra0_show'] ~= '' and style.label[cat_title]['extra0_show'] ~= nil then
			text = text .. ' « [[:Κατηγορία:' .. style.label[cat_title]['extra0'] .. '|' .. style.label[cat_title]['extra0_show'] .. ']]'
			else
			text = text .. ' « [[:Κατηγορία:' .. style.label[cat_title]['extra0'] .. '|' .. style.label[cat_title]['extra0'] .. ']]'
			end
		end
		if style.label[cat_title]['extra1'] ~= '' and style.label[cat_title]['extra1'] ~= nil then
			if style.label[cat_title]['extra1_show'] ~= '' and style.label[cat_title]['extra1_show'] ~= nil then
			text = text .. ' « [[:Κατηγορία:' .. style.label[cat_title]['extra1'] .. '|' .. style.label[cat_title]['extra1_show'] .. ']]'
			else
			text = text .. ' « [[:Κατηγορία:' .. style.label[cat_title]['extra1'] .. '|' .. style.label[cat_title]['extra1'] .. ']]'
			end
		end
		-- descr
		if style.label[cat_title]['descr'] ~= '' and style.label[cat_title]['descr'] ~= nil then
			text_plus = '<dl><dd>' .. style.label[cat_title]['descr'] .. '</dd></dl>'
		end

		-- cat a	-- MUST have parent		
		cat = '[[Κατηγορία:' .. style.label[cat_title]['parent'] .. '| ' .. style.label[cat_title]['key'] .. ']]' ..  "\n" -- sort top
		if style.label[cat_title]['extra1'] ~= '' and style.label[cat_title]['extra1'] ~= nil then
			cat = cat .. '[[Κατηγορία:' .. style.label[cat_title]['extra1'] .. '| ' .. style.label[cat_title]['key'] .. ']]' ..  "\n" -- sort top
		end
		-- ALWAYS PUT AT [[:Κατηγορία:Υφολογικές κατηγορίες]] nomatter what
		cat = cat .. '[[Κατηγορία:Υφολογικές κατηγορίες|' .. style.label[cat_title]['key'] .. ']]' ..  "\n" 
		if style.label[cat_title]['extra2'] ~= '' and style.label[cat_title]['extra2'] ~= nil then
			cat = cat .. '[[Κατηγορία:' .. style.label[cat_title]['extra2'] .. '| ' .. style.label[cat_title]['key'] .. ']]' ..  "\n" -- sort top
		end
		if style.label[cat_title]['extra3'] ~= '' and style.label[cat_title]['extra3'] ~= nil then
			cat = cat .. '[[Κατηγορία:' .. style.label[cat_title]['extra3'] .. '| ' .. style.label[cat_title]['key'] .. ']]' ..  "\n" -- sort top
		end
	
	else
-- b mode 
		text = text_lang
		if style.label[cat_title]['parent4'] ~= '' and style.label[cat_title]['parent4'] ~= nil then
			text = text .. ' » [[:Κατηγορία:' .. style.label[cat_title]['parent4'] .. ' (' .. lang_name .. ')|' .. style.label[cat_title]['parent4'] .. ']]'
		end	
		if style.label[cat_title]['parent3'] ~= '' and style.label[cat_title]['parent3'] ~= nil then
			text = text .. ' » [[:Κατηγορία:' .. style.label[cat_title]['parent3'] .. ' (' .. lang_name .. ')|' .. style.label[cat_title]['parent3'] .. ']]'
		end	
		if style.label[cat_title]['parent2'] ~= '' and style.label[cat_title]['parent2'] ~= nil then
			if style.label[cat_title]['parent2_show'] ~= '' and style.label[cat_title]['parent2_show'] ~= nil then
			text = text .. ' » [[:Κατηγορία:' .. style.label[cat_title]['parent2'] .. ' (' .. lang_name .. ')|' .. style.label[cat_title]['parent2_show'] .. ']]'
			else
			text = text .. ' » [[:Κατηγορία:' .. style.label[cat_title]['parent2'] .. ' (' .. lang_name .. ')|' .. style.label[cat_title]['parent2'] .. ']]'
			end
		end	
	
		if style.label[cat_title]['parent'] ~= '' and style.label[cat_title]['parent'] ~= nil then
			if style.label[cat_title]['parent_show'] ~= '' and style.label[cat_title]['parent_show'] ~= nil then
			text = text .. ' » [[:Κατηγορία:' .. style.label[cat_title]['parent'] .. ' (' .. lang_name .. ')|' .. style.label[cat_title]['parent_show'] .. ']]'
			else
			text = text .. ' » [[:Κατηγορία:' .. style.label[cat_title]['parent'] .. ' (' .. lang_name .. ')|' .. style.label[cat_title]['parent'] .. ']]'
			end
		end
		if style.label[cat_title]['show'] ~= '' and style.label[cat_title]['show'] ~= nil then
			text = text .. ' » [[:Κατηγορία:' .. cat_title .. ' (' .. lang_name .. ')|' .. style.label[cat_title]['show'] .. ']]' .. ' [[:Κατηγορία:' .. cat_title .. '|«««]]'
		else
			text =  text .. textit_lang .. ' [[:Κατηγορία:' .. cat_title .. '|«««]]'
		end
	
		-- extra0 ONLY in text, not at categories
		if style.label[cat_title]['extra0'] ~= '' and style.label[cat_title]['extra0'] ~= nil then
			if style.label[cat_title]['extra0_show'] ~= '' and style.label[cat_title]['extra0_show'] ~= nil then
			text = text .. ' « [[:Κατηγορία:' .. style.label[cat_title]['extra0'] .. ' (' .. lang_name .. ')|' .. style.label[cat_title]['extra0_show'] .. ']]'
			else
			text = text .. ' « [[:Κατηγορία:' .. style.label[cat_title]['extra0'] .. ' (' .. lang_name .. ')|' .. style.label[cat_title]['extra0'] .. ']]'
			end
		end	
		if style.label[cat_title]['extra1'] ~= '' and style.label[cat_title]['extra1'] ~= nil then
			if style.label[cat_title]['extra1_show'] ~= '' and style.label[cat_title]['extra1_show'] ~= nil then
			text = text .. ' « [[:Κατηγορία:' .. style.label[cat_title]['extra1'] .. ' (' .. lang_name .. ')|' .. style.label[cat_title]['extra1_show'] .. ']]'
			else
			text = text .. ' « [[:Κατηγορία:' .. style.label[cat_title]['extra1'] .. ' (' .. lang_name .. ')|' .. style.label[cat_title]['extra1'] .. ']]'
			end
		end	
		-- check [[:Κατηγορία:Υποκοριστικοί όροι (ελληνιστική κοινή)]]
		if languages[lang_iso].sublang == true then
			text = text .. ' <dl><dd>« [[:Κατηγορία:' .. cat_title .. ' (' .. languages[lang_iso].host_name .. ')]]</dd></dl>'
		end
		-- descr
		if style.label[cat_title]['descr'] ~= '' and style.label[cat_title]['descr'] ~= nil then
			text_plus = '<dl><dd>' .. style.label[cat_title]['descr'] .. '</dd></dl>'
		end

		-- cat b	-- MUST have parent
		if languages[lang_iso].sublang == true then
			cat = '[[Κατηγορία:' .. cat_title .. ' (' .. languages[lang_iso].host_name .. ')|' .. languages[lang_iso].host_key .. ']]' ..  "\n"
			.. '[[Κατηγορία:' .. style.label[cat_title]['parent'] .. ' (' .. lang_name .. ')|' .. style.label[cat_title]['key'] .. ']]' ..  "\n"
		else
			cat = '[[Κατηγορία:' .. cat_title .. '|' .. lang_key .. ']]' ..  "\n"
			.. '[[Κατηγορία:' .. style.label[cat_title]['parent'] .. ' (' .. lang_name .. ')|' .. style.label[cat_title]['key'] .. ']]' -- ??srt -- normal
		end -- close hosted languages
		-- ALWAYS PUT AT  Κατηγορία:Υφολογικές κατηγορίες (language) nomatter what
		cat = cat .. '[[Κατηγορία:Υφολογικές κατηγορίες (' .. lang_name .. ')|' .. style.label[cat_title]['key'] .. ']]' ..  "\n"
		if style.label[cat_title]['extra1'] ~= '' and style.label[cat_title]['extra1'] ~= nil then
			cat = cat .. '[[Κατηγορία:' .. style.label[cat_title]['extra1'] .. ' (' .. lang_name .. ')|' .. style.label[cat_title]['key'] .. ']]' ..  "\n"
		end
		if style.label[cat_title]['extra2'] ~= '' and style.label[cat_title]['extra2'] ~= nil then
			cat = cat .. '[[Κατηγορία:' .. style.label[cat_title]['extra2'] .. ' (' .. lang_name .. ')|' .. style.label[cat_title]['key'] .. ']]' ..  "\n"
		end	
		if style.label[cat_title]['extra3'] ~= '' and style.label[cat_title]['extra3'] ~= nil then
			cat = cat .. '[[Κατηγορία:' .. style.label[cat_title]['extra3'] .. ' (' .. lang_name .. ')|' .. style.label[cat_title]['key'] .. ']]' ..  "\n"
		end	
	end -- close cat_parenthesis
end -- close STYLE



--------------------------------------------------------------------------
-- AFFIXES  with PREFIX - with INFIX - with SUFFIX - with COMBINING FORM --
--              Λέξεις με πρόθημα/ένθημα/πρόθημα/συνθετικό              --
--                          and +for names
--------------------------------------------------------------------------
-- οι σκέτοι τίτλοι [[:Κατηγορία:Προθήματα]], [[:Κατηγορία:Λέξεις κατά πρόθημα]], κλπ όπως στο [[Module:auto cat/data]]

	local autosort = ''
	local sort = args[1] or args['sort'] or '' 
	local show_other = args[2] or args['alt'] or '' -- show alternative
	local other_lemma = args['lemma'] or args['λήμμα'] or args['άλλο'] or '' -- link to different lemma
	local other_cat = args['cat'] or args['κατ'] or '' -- Category for different affix, same kind of affix
	local other_link = args['link'] or args['λινκ'] or '' -- NOT USED different link, not just the affix
			-- [[:Κατηγορία:Γυναικεία επώνυμα με επίθημα -άδη (νέα ελληνικά)]]
	local multicat = args['multi'] or args['πολυ'] or '' -- add to multilingual category 
			-- [[:Κατηγορία:Λέξεις γλωσσών με κοινό επίθημα]]
	local compound = args['compound'] or args['comp'] or args['συνθετικό'] or args['σύνθετο'] or args['συνθ'] or '' 
			-- only for name categories [[:Κατηγορία:Ανδρικά ονόματα με επίθημα -γιάννης (νέα ελληνικά)]]
	local cat_plus = args['cat+'] or args['κατ+'] or '' -- extra cat of  the same kind 
			-- [[Κατηγορία:Λέξεις με πρόθημα ματο- από αιματο- (νέα ελληνικά)]] +ΚΑΤ Λέξεις με πρόθημα ματο- (νέα ελληνικά)
	local multisense = args['multisense'] or args['πολύσημο'] or '' 
			-- added at Cateogry pages hosting subcategories add Κατηγορία:Λέξεις κατά πολύσημα προθήματα (νέα ελληνικά) 
				-- add it to [[:Λέξεις με πρόθημα ματο- (νέα ελληνικά)]]
	local nohost = args['nohost'] or '' -- only for [[Module:Languages]].sublang DO NOT give the host language data. 
			-- [[:Κατηγορία:Λέξεις με επίθημα -ίδιον (καθαρεύουσα)]] There is no -ίδιον for el.
	local host_lemma = args['hostlemma'] or ''
	-- και μόνο για Κατ.Λέξεις με πρόθημα, param plus_in_infix (π.χ. η [[:Κατηγορία:Λέξεις με πρόθημα ψυχο- (νέα ελληνικά)]] 
			-- να μπει ΚΑΙ στην [[:Κατηγορία:Λέξεις με ένθημα -ο (νέα ελληνικά)]])
	-- and see section Combining form for param plus_in_prefix, plus_in_suffix

-- test [[:Κατηγορία:Λέξεις με πρόθημα συν- (νέα ελληνικά)]] [[:Κατηγορία:Λέξεις με επίθημα -ά (νέα ελληνικά)]]

-- PREFIXES prefix params
if mw.ustring.find(cat_title, "Λέξεις με πρόθημα") then 
catword = 'Λέξεις με πρόθημα' 
cat_affix = 'Προθήματα'
in_cat = 'κατά πρόθημα'
-- affix.  prefix multisense. 
	-- Κατηγορία:Λέξεις με πρόθημα ανθ- από το αντι- (νέα ελληνικά)
	-- Κατηγορία:Λέξεις με πρόθημα α, προτακτικό (νέα ελληνικά)
-- For manual editing from page, write |lemma=  and |cat=
-- for param affix+id (for prefix) ALL PARAMETERS at: [[Module:auto cat/param-prefix-id]]
-- ?# PROBLEM when 2 words after comma like Κατηγορία:Λέξεις με πρόθημα απειρο-, πολύ μεγάλος (νέα ελληνικά)
		-- εδώ, υπάρχει λίστα με όλα τα πολύσημα προθήματα
		-- here is a list with all available multisense id of prefixes
	require (module_path .. 'param-prefix-id').param (args)
	if mw.ustring.find(cat_title, "από το") or mw.ustring.find(cat_title, ",")
	then 
		other_cat = other_cat_id
		autosort = sort_it -- Κατηγορία:Λέξεις με πρόθημα άν- από το στερητικό α- (νέα ελληνικά) 
						-- Κατηγορία:Λέξεις με πρόθημα ἅ-, αθροιστικό (αρχαία ελληνικά)
	end
-- with no id	
	if mw.ustring.sub(mw.ustring.match(cat_title, "Λέξεις με πρόθημα (.*)"), 1, -1):sub(-1) == '-'
	then
	-- check [[:Κατηγορία:Λέξεις με πρόθημα ἔν- (αρχαία ελληνικά)]]
	autosort = m_utilities.sortkey(mw.ustring.sub(mw.ustring.match(cat_title, "Λέξεις με πρόθημα (.*)"), 1, -2)) -- no hyphen
	else
	autosort = affix
	end
catword_multicat = 'Λέξεις γλωσσών με κοινό πρόθημα'
catword_multisense = 'Λέξεις κατά πολύσημα προθήματα' --  [[:Κατηγορία:Λέξεις με πρόθημα αν- (νέα ελληνικά)]]
--mw.addWarning('<b><span style="color:#b22222; font-size:14px;">Αν χρειάζεται, συμπληρώστε με &#123;&#123;auto cat|xxx}} την κλείδα κατάταξης sort.</span></b>')
end

-- INFIXES infix params
if mw.ustring.find(cat_title, "Λέξεις με ένθημα") then 
catword = 'Λέξεις με ένθημα' 
cat_affix = 'Ενθήματα'
in_cat = 'κατά ένθημα'
affix = mw.ustring.sub(mw.ustring.match(cat_title, "Λέξεις με ένθημα (.*)"), 1, -1)  -- this is hyphen+affix+hyphen
	if mw.ustring.sub(mw.ustring.match(cat_title, "Λέξεις με ένθημα (.*)"), 1, -1):sub(1, 1) == '-'
	and mw.ustring.sub(mw.ustring.match(cat_title, "Λέξεις με ένθημα (.*)"), 1, -1):sub(-1) == '-'
	then
	-- check [[:Κατηγορία:Λέξεις με ένθημα -ί- (αρχαία ελληνικά)]]
	autosort = m_utilities.sortkey(mw.ustring.sub(mw.ustring.match(cat_title, "Λέξεις με ένθημα (.*)"), 2, -2)) -- no hyphens
	else
	autosort = affix
	end
catword_multicat = 'Λέξεις γλωσσών με κοινό ένθημα'
end

-- SUFFIXES suffix params
if mw.ustring.find(cat_title, "Λέξεις με επίθημα") then 
catword = 'Λέξεις με επίθημα' 
cat_affix = 'Επιθήματα'
in_cat = 'κατά επίθημα'
	affix = mw.ustring.sub(mw.ustring.match(cat_title, "Λέξεις με επίθημα (.*)"), 1, -1)  -- this is hyphen+affix
	if mw.ustring.sub(mw.ustring.match(cat_title, "Λέξεις με επίθημα (.*)"), 1, -1):sub(1, 1) == '-'
	then
	-- check [[:Κατηγορία:Λέξεις με επίθημα -gène (γαλλικά)]] check sorting at [[:Κατηγορία:Λέξεις κατά επίθημα (γαλλικά)]]
	autosort = m_utilities.sortkey(mw.ustring.sub(mw.ustring.match(cat_title, "Λέξεις με επίθημα (.*)"), 2, -1)) -- no hyphen
	else
	autosort = affix
	end
catword_multicat = 'Λέξεις γλωσσών με κοινό επίθημα'
catword_multisense = 'Λέξεις κατά πολύσημα επιθήματα' --  [[:Κατηγορία:Λέξεις με επίθημα -α (νέα ελληνικά)]] 
end

-- combining form params
if mw.ustring.find(cat_title, "Λέξεις με συνθετικό") then 
catword = 'Λέξεις με συνθετικό' 
cat_affix = 'Σύνθετα'
in_cat = 'κατά συνθετικό'
	affix = mw.ustring.sub(mw.ustring.match(cat_title, "Λέξεις με συνθετικό (.*)"), 2, -2)  -- this is the combining form without apostrophs
	if mw.ustring.sub(mw.ustring.match(cat_title, "Λέξεις με συνθετικό (.*)"), 1, -1):sub(1) == "'" -- apostroph at beginning
	and mw.ustring.sub(mw.ustring.match(cat_title, "Λέξεις με συνθετικό (.*)"), 1, -1):sub(-1) == "'" -- apostroph at end
	then
	autosort = m_utilities.sortkey(mw.ustring.sub(mw.ustring.match(cat_title, "Λέξεις με συνθετικό (.*)"), 2, -2)) -- no apostrophs
	else
	autosort = affix
	end
catword_multicat = 'Λέξεις γλωσσών με κοινό συνθετικό'
end

-- =============== AFFIXES: apply with prefix, with infix, with suffix
if mw.ustring.find(cat_title, "Λέξεις με πρόθημα") or mw.ustring.find(cat_title, "Λέξεις με ένθημα") 
	or mw.ustring.find(cat_title, "Λέξεις με επίθημα") 
then


-- a mode, no (language) -- [[:Κατηγορία:Λέξεις με πρόθημα in-]] (the category includes latin, english, etc)
	if cat_parenthesis == '' or cat_parenthesis == nil then
		text = text_wikt .. ' » [[:Κατηγορία:Ετυμολογία|Ετυμολογία]] » [[:Κατηγορία:Μορφολογία|Μορφολογία]]'
		.. ' » [[:Κατηγορία:Προσφύματα|Προσφύματα]]'
		.. ' » [[:Κατηγορία:' .. cat_affix .. '|' .. cat_affix .. ']]'
		.. ' » [[:Κατηγορία:Λέξεις ' .. in_cat .. '|Λέξεις ' .. in_cat .. ']]'
		if show_other == '' or show_other == nil then
			text = text .. ' » [[' .. affix .. '|<b>' .. affix .. '</b>]]'
		else
			text = text  .. ' » [[' .. affix .. '|<b>' .. show_other .. '</b>]]' -- alt, show alternative
		end

		-- cat a -- #####missing param other_cat ##no multisense
		if sort == '' or sort == nil then
			cat = '[[Κατηγορία:' .. catword_multicat .. '|' .. autosort .. ']]' ..  "\n"			
		else
			cat = '[[Κατηγορία:' .. catword_multicat .. '|' .. sort .. ']]' ..  "\n"
		end

	else -- with language
-- b mode e.g. [[:Κατηγορία:Λέξεις με πρόθημα συν- (νέα ελληνικά)]] PLUS param nohost e.g. [[:Κατηγορία:Λέξεις με επίθημα -ίδιον (καθαρεύουσα)]] There is no -ίδιον for el. 	
		text = text_lang .. ' » [[:Κατηγορία:Ετυμολογία (' .. lang_name .. ')|Ετυμολογία]]'
		.. ' » [[:Κατηγορία:Μορφολογία (' .. lang_name .. ')|Μορφολογία]]'
		.. ' » [[:Κατηγορία:Προσφύματα (' .. lang_name .. ')|Προσφύματα]]'
		.. ' » [[:Κατηγορία:' .. cat_affix .. ' (' .. lang_name .. ')|' .. cat_affix .. ']]'
		.. ' » [[:Κατηγορία:Λέξεις ' .. in_cat .. ' (' .. lang_name .. ')|Λέξεις ' .. in_cat .. ']]'
		if other_lemma == '' or other_lemma == nil then
			if show_other == '' or show_other == nil then
			text = text .. ' » [[' .. affix .. "#" .. languages[lang_iso].link .. '|<b>' .. affix .. '</b>]]'
			else
			text = text .. ' » [[' .. affix .. "#" .. languages[lang_iso].link .. '|<b>' .. show_other .. '</b>]]'
			end
		else -- give a different link [[:Κατηγορία:Λέξεις με πρόθημα δι- από το δια- (νέα ελληνικά)]]
			if show_other == '' or show_other == nil then
			text = text .. ' » [[' .. other_lemma .. "#" .. languages[lang_iso].link .. '|<b>' .. other_lemma .. '</b>]]'
			else
			text = text .. ' » [[' .. other_lemma .. "#" .. languages[lang_iso].link .. '|<b>' .. show_other .. '</b>]]'
			end
		end
	
-- πολύσημο (multisense) with comma e.g. Κατηγορία:Λέξεις με πρόθημα α-, προτακτικό (νέα ελληνικά)
		-- or with από...  e.g. Κατηγορία:Λέξεις με επίθημα -της, αρσενικό (αρχαία ελληνικά) Κατηγορία:Λέξεις με πρόθημα ανθ- από το αντι- (νέα ελληνικά)
--		if (mw.ustring.find(cat_title, "από το") or mw.ustring.find(cat_title, ","))
--		and other_lemma ~= '' and other_lemma ~= nil
--		then
--			text = text .. ' « [[:Κατηγορία:' .. catword .. ' ' .. other_lemma .. ' (' .. languages[lang_iso].name .. ')|' .. catword .. ' ' .. other_lemma .. ']]' 	
--		end		
		
	-- check [[:Κατηγορία:Λέξεις με πρόθημα ψυχο- (ελληνιστική κοινή)]]
		if languages[lang_iso].sublang == true then
		if nohost == '1' then		
			text = text
		else -- no nohost [[:Κατηγορία:Λέξεις με πρόθημα ἐρυθρο- (καθαρεύουσα)]] must give ερυθρο- (νέα ελληνικά)
			if host_lemma == '' or host_lemma == nil then
				text = text .. ' <dl><dd>« [[:Κατηγορία:' .. catword .. ' ' .. affix .. ' (' .. languages[lang_iso].host_name .. ')]]</dd></dl>' 	
			else -- give a different affix for the host language 
				text = text .. ' <dl><dd>« [[:Κατηγορία:' .. catword .. ' ' .. host_lemma .. ' (' .. languages[lang_iso].host_name .. ')]]</dd></dl>' 
			end
		end -- close nohost
		end -- close if sublang

		if multicat ~= '' and multicat ~= nil then -- e.g. [[:Κατηγορία:Λέξεις με επίθημα -ation (αγγλικά)]]
			text = text .. ' [[:Κατηγορία:' .. catword .. ' ' .. affix .. '|«««]]' 	
		end
		
		-- cat b 
		
		if other_cat ~= '' and other_cat ~= nil then
			if languages[lang_iso].sublang == true then
			if nohost == '1' then
				if sort == '' or sort == nil then
				cat = '[[Κατηγορία:' .. catword .. ' ' .. other_cat .. ' (' .. lang_name .. ')|' .. autosort .. ']]' .. "\n"
				else
				cat = '[[Κατηγορία:' .. catword .. ' ' .. other_cat .. ' (' .. lang_name .. ')|' .. sort .. ']]' .. "\n"
				end		
			else -- WITH host	
			if host_lemma == '' or host_lemma == nil then
				if sort == '' or sort == nil then
				cat = '[[Κατηγορία:' .. catword .. ' ' .. other_cat .. ' (' .. lang_name .. ')|' .. autosort .. ']]' .. "\n"
				.. '[[Κατηγορία:' .. catword .. ' ' .. affix  .. ' (' .. languages[lang_iso].host_name .. ')|' .. languages[lang_iso].key .. ']]' ..  "\n"
				else
				cat = '[[Κατηγορία:' .. catword .. ' ' .. other_cat .. ' (' .. lang_name .. ')|' .. sort .. ']]' .. "\n"
				.. '[[Κατηγορία:' .. catword .. ' ' .. affix .. ' (' .. languages[lang_iso].host_name .. ')|' .. languages[lang_iso].key .. ']]' ..  "\n"
				end
			else -- there is a different args['hostlemma']
				if sort == '' or sort == nil then
				cat = '[[Κατηγορία:' .. catword .. ' ' .. other_cat .. ' (' .. lang_name .. ')|' .. autosort .. ']]' .. "\n"
				.. '[[Κατηγορία:' .. catword .. ' ' .. host_lemma  .. ' (' .. languages[lang_iso].host_name .. ')|' .. languages[lang_iso].key .. ']]' ..  "\n"
				else
				cat = '[[Κατηγορία:' .. catword .. ' ' .. other_cat .. ' (' .. lang_name .. ')|' .. sort .. ']]' .. "\n"
				.. '[[Κατηγορία:' .. catword .. ' ' .. host_lemma .. ' (' .. languages[lang_iso].host_name .. ')|' .. languages[lang_iso].key .. ']]' ..  "\n"
				end
			end -- close if host_lemma
			end -- close nohost
			else -- no sublang	-- [[:Κατηγορία:Λέξεις με πρόθημα α-, προτακτικό (νέα ελληνικά)]]
				if sort == '' or sort == nil then
				cat = '[[Κατηγορία:' .. catword .. ' ' .. other_cat .. ' (' .. lang_name .. ')|' .. autosort .. ']]' .. "\n"		
				else
				cat = '[[Κατηγορία:' .. catword .. ' ' .. other_cat .. ' (' .. lang_name .. ')|' .. sort .. ']]' .. "\n"
				end
			end -- close sublang

		else -- (no other_cat) -- check [[:Κατηγορία:Λέξεις με ένθημα -ο- (ελληνιστική κοινή)]]
			if languages[lang_iso].sublang == true then
			if nohost == '1' then
				if sort == '' or sort == nil then
				cat = '[[Κατηγορία:Λέξεις ' .. in_cat .. ' (' .. lang_name .. ')|' .. autosort .. ']]' .. "\n"	
				else
				cat = '[[Κατηγορία:Λέξεις ' .. in_cat .. ' (' .. lang_name .. ')|' .. sort .. ']]' ..  "\n"
				end
			else -- WITH host
			if host_lemma == '' or host_lemma == nil then
				if sort == '' or sort == nil then
				cat = '[[Κατηγορία:Λέξεις ' .. in_cat .. ' (' .. lang_name .. ')|' .. autosort .. ']]' .. "\n"	
				.. '[[Κατηγορία:' .. catword .. ' ' .. affix .. ' (' .. languages[lang_iso].host_name .. ')|' .. languages[lang_iso].key .. ']]' ..  "\n"
				else
				cat = '[[Κατηγορία:Λέξεις ' .. in_cat .. ' (' .. lang_name .. ')|' .. sort .. ']]' ..  "\n"
				.. '[[Κατηγορία:' .. catword .. ' ' .. affix .. ' (' .. languages[lang_iso].host_name .. ')|' .. languages[lang_iso].key .. ']]' ..  "\n"
				end
			else -- args['hostlemma'] is different
				if sort == '' or sort == nil then
				cat = '[[Κατηγορία:Λέξεις ' .. in_cat .. ' (' .. lang_name .. ')|' .. autosort .. ']]' .. "\n"	
				.. '[[Κατηγορία:' .. catword .. ' ' .. host_lemma .. ' (' .. languages[lang_iso].host_name .. ')|' .. languages[lang_iso].key .. ']]' ..  "\n"
				else
				cat = '[[Κατηγορία:Λέξεις ' .. in_cat .. ' (' .. lang_name .. ')|' .. sort .. ']]' ..  "\n"
				.. '[[Κατηγορία:' .. catword .. ' ' .. host_lemma .. ' (' .. languages[lang_iso].host_name .. ')|' .. languages[lang_iso].key .. ']]' ..  "\n"
				end
			end -- close host_lemma
			end -- close nohost
			else -- no sublang	
				if sort == '' or sort == nil then
				cat = '[[Κατηγορία:Λέξεις ' .. in_cat .. ' (' .. lang_name .. ')|' .. autosort .. ']]' .. "\n"		
				else
				cat = '[[Κατηγορία:Λέξεις ' .. in_cat .. ' (' .. lang_name .. ')|' .. sort .. ']]' ..  "\n"
				end
			end -- close sublang
		end -- close other_cat


		if multicat ~= '' and multicat ~= nil then -- e.g. [[:Κατηγορία:Λέξεις με επίθημα -ation]] (en, fr)
			cat = cat .. '[[Κατηγορία:' .. catword .. ' ' .. affix .. '|' .. languages[lang_iso].key .. ']]' .. "\n"		
		end
		if cat_plus ~= '' and cat_plus ~= nil then -- [[:Κατηγορία:Λέξεις με επίθημα -τζή (νέα ελληνικά)]]
			cat = cat .. '[[Κατηγορία:' .. catword .. ' ' .. cat_plus .. ' (' .. lang_name .. ')| ]]' .. "\n" -- sort top
		end
		-- check   [[:Κατηγορία:Λέξεις με πρόθημα αφρο- (νέα ελληνικά)]] as it is sorted in [[:Κατηγορία:Λέξεις κατά πολύσημα προθήματα (νέα ελληνικά)]]
		if multisense ~= '' and multisense ~= nil then
			cat = cat .. '[[Κατηγορία:' ..  catword_multisense .. ' (' .. lang_name .. ')|' .. autosort .. ']]' .. "\n"
		end
		
		
	-- PLUS: μόνο για Κατ.προθημάτων: [[:Κατηγορία:Λέξεις με πρόθημα ψυχο- (νέα ελληνικά)]] να μπει ΚΑΙ στην [[:Κατηγορία:Λέξεις με ένθημα -ο- (νέα ελληνικά)]])
		local plus_in_infix = args['infix'] or args['interfix'] or args['ενθ'] or args['ένθ'] or args['ένθημα'] or ''
		if mw.ustring.find(cat_title, "Λέξεις με πρόθημα") then
			if plus_in_infix ~= '' and plus_in_infix ~= nil then
				if sort == '' or sort == nil then
				cat = cat .. '[[Κατηγορία:Λέξεις με ένθημα ' .. plus_in_infix .. ' (' .. lang_name .. ')|' .. autosort .. ']]' .. "\n"		
				else
				cat = cat .. '[[Κατηγορία:Λέξεις με ένθημα ' .. plus_in_infix .. ' (' .. lang_name .. ')|' .. sort .. ']]' ..  "\n"
				end
			end -- plus_in_infix
		end -- if Λέξεις με πρόθημα
		
	end -- close cat_parenthesis
end -- close affixes



-- =============== with combining form: συνθετικό ΧΩΡΙΣ τον τίτλο 'Προσφύματα'
local plus_in_prefix = args['pref'] or args['προ'] or args['πρό'] or args['πρόθημα'] or ''		-- ΚΑΙ στην Κατηγορία:Λέξεις κατά πρόθημα -- also in Category:Words by prefix...
local plus_in_suffix = args['suf'] or args['επι'] or args['επί'] or args['επίθημα'] or ''		-- ΚΑΙ στην Κατηγορία:Λέξεις κατά επίθημα -- also in Category:Words by suffix...

if mw.ustring.find(cat_title, "Λέξεις με συνθετικό") 
then
-- a mode, no (language)
	if cat_parenthesis == '' or cat_parenthesis == nil then
		text = text_wikt .. ' » [[:Κατηγορία:Ετυμολογία|Ετυμολογία]] » [[:Κατηγορία:Μορφολογία|Μορφολογία]]'
		.. ' » [[:Κατηγορία:' .. cat_affix .. '|' .. cat_affix .. ']]'
		.. ' » [[:Κατηγορία:Λέξεις ' .. in_cat .. '|Λέξεις ' .. in_cat .. ']]'
		if show_other == '' or show_other == nil then
			text = text .. ' » [[' .. affix .. '|<b>' .. affix .. '</b>]]'
		else
			text = text  .. ' » [[' .. affix .. '|<b>' .. show_other .. '</b>]]' -- alt, show alternative
		end

		-- cat a
		if sort == '' or sort == nil then
			cat = '[[Κατηγορία:Λέξεις γλωσσών ' .. in_cat .. '|' .. autosort .. ']]' ..  "\n"
				if args['προ'] == '1' or args['pref'] then
				cat = cat .. '[[Κατηγορία:Λέξεις γλωσσών με κοινό πρόθημα|' .. autosort .. ']]' ..  "\n"
				end
				if args['επι'] == '1' or args['suf'] then
				cat = cat .. '[[Κατηγορία:Λέξεις γλωσσών με κοινό επίθημα|' .. autosort .. ']]' ..  "\n"
				end	
		else
			cat = '[[Κατηγορία:Λέξεις γλωσσών ' .. in_cat .. '|' .. sort .. ']]' ..  "\n"
				if args['προ'] == '1' or args['pref'] then
				cat = cat .. '[[Κατηγορία:Λέξεις γλωσσών με κοινό πρόθημα|' .. sort .. ']]' ..  "\n"
				end
				if args['επι'] == '1' or args['suf'] then
				cat = cat .. '[[Κατηγορία:Λέξεις γλωσσών με κοινό επίθημα|' .. sort .. ']]' ..  "\n"
				end		
		end

	else -- with language
-- b mode e.g. -- [[:Κατηγορία:Λέξεις με συνθετικό 'βιομηχανία' (νέα ελληνικά)]]
		text = text_lang .. ' » [[:Κατηγορία:Ετυμολογία (' .. lang_name .. ')|Ετυμολογία]]'
		.. ' » [[:Κατηγορία:Μορφολογία (' .. lang_name .. ')|Μορφολογία]]'
		.. ' » [[:Κατηγορία:' .. cat_affix .. ' (' .. lang_name .. ')|' .. cat_affix .. ']]'
		.. ' » [[:Κατηγορία:Λέξεις ' .. in_cat .. ' (' .. lang_name .. ')|Λέξεις ' .. in_cat .. ']]'
		if other_lemma == '' or other_lemma == nil then
			if show_other == '' or show_other == nil then
			text = text .. ' » [[' .. affix .. "#" .. languages[lang_iso].link .. '|<b>' .. affix .. '</b>]]'
			else
			text = text .. ' » [[' .. affix .. "#" .. languages[lang_iso].link .. '|<b>' .. show_other .. '</b>]]'
			end
		else -- give a different link
			if show_other == '' or show_other == nil then
			text = text .. ' » [[' .. other_lemma .. "#" .. languages[lang_iso].link .. '|<b>' .. other_lemma .. '</b>]]'
			else
			text = text .. ' » [[' .. other_lemma .. "#" .. languages[lang_iso].link .. '|<b>' .. show_other .. '</b>]]'
			end
		end
		if languages[lang_iso].sublang == true then
		if nohost == '1' then		
			text = text
		else -- no nohost
			if host_lemma == '' or host_lemma == nil then
				text = text .. ' <dl><dd>« [[:Κατηγορία:' .. catword .. ' ' .. "'" .. affix .. "'" .. ' (' .. languages[lang_iso].host_name .. ')]]</dd></dl>' 	
			else -- give a different affix for the host language 
				text = text .. ' <dl><dd>« [[:Κατηγορία:' .. catword .. ' ' .. "'".. host_lemma.. "'" .. ' (' .. languages[lang_iso].host_name .. ')]]</dd></dl>' 
			end
		end -- close nohost
		end -- close if sublang
		
		-- cat b
			if other_cat ~= '' and other_cat ~= nil then
			if languages[lang_iso].sublang == true then
				if sort == '' or sort == nil then
				cat = '[[Κατηγορία:Λέξεις ' .. in_cat .. ' (' .. lang_name .. ')|' .. other_cat .. ']]' .. "\n"	
				.. '[[Κατηγορία:' .. catword .. " '" .. affix .. "' (" .. languages[lang_iso].host_name .. ')|' .. other_cat .. ']]' ..  "\n"
				else
				cat = '[[Κατηγορία:Λέξεις ' .. in_cat .. ' (' .. lang_name .. ')|' .. sort .. ']]' ..  "\n"
				.. '[[Κατηγορία:' .. catword .. " '" .. affix .. "' (" .. languages[lang_iso].host_name .. ')|' .. sort .. ']]' ..  "\n"
				end				
			else -- no sublang	
				if sort == '' or sort == nil then
				cat = '[[Κατηγορία:Λέξεις ' .. in_cat .. ' (' .. lang_name .. ')|' .. other_cat .. ']]' .. "\n"		
				else
				cat = '[[Κατηγορία:Λέξεις ' .. in_cat .. ' (' .. lang_name .. ')|' .. sort .. ']]' ..  "\n"
				end
			end -- close sublang				
			else -- (no other_cat)
			if languages[lang_iso].sublang == true then
				if sort == '' or sort == nil then
				cat = '[[Κατηγορία:Λέξεις ' .. in_cat .. ' (' .. lang_name .. ')|' .. autosort .. ']]' .. "\n"	
				.. '[[Κατηγορία:' .. catword .. " '" .. affix ..  "' (" .. languages[lang_iso].host_name .. ')|' .. autosort .. ']]' ..  "\n"
					if args['προ'] == '1' or args['pref'] then -- [[:Κατηγορία:Λέξεις με συνθετικό 'Γιάννης' (νέα ελληνικά)]]
					cat = cat .. '[[Κατηγορία:Λέξεις κατά πρόθημα (' .. lang_name .. ')|' .. autosort .. ']]' ..  "\n"
					.. '[[Κατηγορία:Λέξεις κατά πρόθημα (' .. lang_name .. ')|' .. autosort .. ']]' ..  "\n"
					end
					if args['επι'] == '1' or args['suf'] then
					cat = cat .. '[[Κατηγορία:Λέξεις κατά επίθημα (' .. lang_name .. ')|' .. autosort .. ']]' ..  "\n"
					end	
				else
				cat = '[[Κατηγορία:Λέξεις ' .. in_cat .. ' (' .. lang_name .. ')|' .. sort .. ']]' ..  "\n"
				.. '[[Κατηγορία:' .. catword .. " '" .. affix .. "' (" .. languages[lang_iso].host_name .. ')|' .. sort .. ']]' ..  "\n"
					if args['προ'] == '1' or args['pref'] then
					cat = cat .. '[[Κατηγορία:Λέξεις κατά πρόθημα (' .. lang_name .. ')|' .. sort .. ']]' ..  "\n"
					end
					if args['επι'] == '1' or args['suf'] then
					cat = cat .. '[[Κατηγορία:Λέξεις κατά επίθημα (' .. lang_name .. ')|' .. sort .. ']]' ..  "\n"
					end	
				end				
			else -- no sublang	
				if sort == '' or sort == nil then
				cat = '[[Κατηγορία:Λέξεις ' .. in_cat .. ' (' .. lang_name .. ')|' .. autosort .. ']]' .. "\n"
					if args['προ'] == '1' or args['pref'] then -- [[:Κατηγορία:Λέξεις με συνθετικό 'Γιάννης' (νέα ελληνικά)]]
					cat = cat .. '[[Κατηγορία:Λέξεις κατά πρόθημα (' .. lang_name .. ')|' .. autosort .. ']]' ..  "\n"
					end
					if args['επι'] == '1' or args['suf'] then
					cat = cat .. '[[Κατηγορία:Λέξεις κατά επίθημα (' .. lang_name .. ')|' .. autosort .. ']]' ..  "\n"
					end
				else
				cat = '[[Κατηγορία:Λέξεις ' .. in_cat .. ' (' .. lang_name .. ')|' .. sort .. ']]' ..  "\n"
					if args['προ'] == '1' or args['pref'] then
					cat = cat .. '[[Κατηγορία:Λέξεις κατά πρόθημα (' .. lang_name .. ')|' .. sort .. ']]' ..  "\n"
					end
					if args['επι'] == '1' or args['suf'] then
					cat = cat .. '[[Κατηγορία:Λέξεις κατά επίθημα (' .. lang_name .. ')|' .. sort .. ']]' ..  "\n"
					end		
				end
			end -- close sublang
			end -- close other_cat


		if multicat ~= '' and multicat ~= nil then -- e.g. [[:Κατηγορία:Λέξεις με επίθημα -ation]] (en, fr)
			cat = cat .. '[[Κατηγορία:' .. catword .. ' ' .. affix .. '|' .. languages[lang_iso].key .. ']]' .. "\n"		
		end

	end -- close cat_parenthesis
end -- close combining form

--------------------------------------------------------------------------
--       Λέξεις με υποκοριστικό επίθημα...  με μεγεθυντικό επίθημ... under επίθημα          --
--        Words with diminutive suffix..., with augmentative suffix... under suffix       --
--------------------------------------------------------------------------
-- οι σκέτοι τίτλοι όπως [[:Κατηγορία:Υποκοριστικοί όροι (νέα ελληνικά)]], [[:Κατηγορία:Λέξεις κατά υποκοριστικό επίθημα (νέα ελληνικά)]]
	-- δημιουργούνται από το [[Module:auto cat/data]]
	-- Ελπίζω, να ισχύουν όλες οι παράμετροι από τα AFFIXES

-- dim params
if mw.ustring.find(cat_title, "Λέξεις με υποκοριστικό επίθημα") then 
catword = 'Λέξεις με υποκοριστικό επίθημα'
cat_affix = 'Λέξεις'
in_cat = 'κατά υποκοριστικό επίθημα'
	affix = mw.ustring.sub(mw.ustring.match(cat_title, "Λέξεις με υποκοριστικό επίθημα (.*)"), 1, -1)  -- this is hyphen+affix
	if mw.ustring.sub(mw.ustring.match(cat_title, "Λέξεις με υποκοριστικό επίθημα (.*)"), 1, -1):sub(1, 1) == '-'
	then
	autosort = m_utilities.sortkey(mw.ustring.sub(mw.ustring.match(cat_title, "Λέξεις με υποκοριστικό επίθημα (.*)"), 2, -1))  -- no hyphen
	else
	autosort = affix
	end
catword_multicat = 'Λέξεις γλωσσών με κοινό υποκοριστικό επίθημα'
end

-- aug params
if mw.ustring.find(cat_title, "Λέξεις με μεγεθυντικό επίθημα") then 
catword = 'Λέξεις με μεγεθυντικό επίθημα'
cat_affix = 'Λέξεις'
in_cat = 'κατά μεγεθυντικό επίθημα'
	affix = mw.ustring.sub(mw.ustring.match(cat_title, "Λέξεις με μεγεθυντικό επίθημα (.*)"), 1, -1)  -- this is hyphen+affix
	if mw.ustring.sub(mw.ustring.match(cat_title, "Λέξεις με μεγεθυντικό επίθημα (.*)"), 1, -1):sub(1, 1) == '-'
	then
	autosort = m_utilities.sortkey(mw.ustring.sub(mw.ustring.match(cat_title, "Λέξεις με μεγεθυντικό επίθημα (.*)"), 2, -1))  -- no hyphen
	else
	autosort = affix
	end
catword_multicat = 'Λέξεις γλωσσών με κοινό μεγεθυντικό επίθημα'
end
 


-- =============== apply με υποκοριστικό επίθημα -- with diminutive suffix NOTE: Not all of them ARE diminutives See [[:Κατηγορία:Υποκοριστικά (νέα ελληνικά)]]
if mw.ustring.find(cat_title, "Λέξεις με υποκοριστικό επίθημα")

then
-- a mode, no (language)
	if cat_parenthesis == '' or cat_parenthesis == nil then
		text = text_wikt .. ' » [[:Κατηγορία:Ετυμολογία|Ετυμολογία]] » [[:Κατηγορία:Μορφολογία|Μορφολογία]]'
		.. ' » [[:Κατηγορία:Προσφύματα|Προσφύματα]]'
		.. ' » [[:Κατηγορία:Επιθήματα|Επιθήματα]]'
		.. ' » [[:Κατηγορία:Υποκοριστικά επιθήματα|' .. 'υποκοριστικά' .. ']]'
		.. ' » [[:Κατηγορία:Λέξεις με επίθημα ' .. affix .. '|επίθημα]]'
		if show_other == '' or show_other == nil then
			text = text .. ' » [[' .. affix .. '|<b>' .. affix .. '</b>]]'
		else
			text = text  .. ' » [[' .. affix .. '|<b>' .. show_other .. '</b>]]' -- alt, show alternative
		end
		text = text .. ' « [[:Κατηγορία:Λέξεις ' .. 'κατά υποκοριστικό επίθημα' .. '|Λέξεις ' .. 'κατά υποκοριστικό επίθημα' .. ']]'
		
		
		-- cat a
		if sort == '' or sort == nil then
			cat = '[[Κατηγορία:' .. cat_affix .. ' κατά υποκοριστικό επίθημα|' .. autosort .. ']]' ..  "\n"	
			.. '[[Κατηγορία:Λέξεις γλωσσών με κοινό υποκοριστικό επίθημα|' .. autosort .. ']]' ..  "\n"			
		else
			cat = '[[Κατηγορία:' .. cat_affix .. ' κατά υποκοριστικό επίθημα|' .. sort .. ']]' ..  "\n"	
			.. '[[Κατηγορία:Λέξεις γλωσσών με κοινό υποκοριστικό επίθημα|' .. sort .. ']]' ..  "\n"
		end

	else -- with language
-- b mode e.g. [[:Κατηγορία:Λέξεις με υποκοριστικό επίθημα -άκι (νέα ελληνικά)]]
		text = text_lang .. ' » [[:Κατηγορία:Ετυμολογία (' .. lang_name .. ')|Ετυμολογία]]'
		.. ' » [[:Κατηγορία:Μορφολογία (' .. lang_name .. ')|Μορφολογία]]'
		.. ' » [[:Κατηγορία:Προσφύματα (' .. lang_name .. ')|Προσφύματα]]'
		.. ' » [[:Κατηγορία:Επιθήματα (' .. lang_name .. ')|Επιθήματα]]'
		.. ' » [[:Κατηγορία:Υποκοριστικά επιθήματα (' .. lang_name .. ')|' .. 'υποκοριστικά' .. ']]'
		.. ' » [[:Κατηγορία:Λέξεις με επίθημα ' .. affix .. ' (' .. lang_name .. ')|με επίθημα]]'
		if other_lemma == '' or other_lemma == nil then
			if show_other == '' or show_other == nil then
			text = text .. ' » [[' .. affix .. "#" .. languages[lang_iso].link .. '|<b>' .. affix .. '</b>]]'
			else
			text = text .. ' » [[' .. affix .. "#" .. languages[lang_iso].link .. '|<b>' .. show_other .. '</b>]]'
			end
		else -- give a different link
			if show_other == '' or show_other == nil then
			text = text .. ' » [[' .. other_lemma .. "#" .. languages[lang_iso].link .. '|<b>' .. other_lemma .. '</b>]]'
			else
			text = text .. ' » [[' .. other_lemma .. "#" .. languages[lang_iso].link .. '|<b>' .. show_other .. '</b>]]'
			end
		end

		if multicat ~= '' and multicat ~= nil then
			text = text .. ' [[:Κατηγορία:' .. catword .. ' ' .. affix .. '|«««]]' 	
		end
		text = text .. ' « [[:Κατηγορία:Λέξεις κατά υποκοριστικό επίθημα (' .. lang_name .. ')|Λέξεις ' .. 'κατά υποκοριστικό επίθημα' .. ']]'
		
	-- check [[:Κατηγορία:Λέξεις με υποκοριστικό επίθημα -ιον (καθαρεύουσα)]]
		if languages[lang_iso].sublang == true then
		if nohost == '1' then		
			text = text
		else -- no nohost
			if host_lemma == '' or host_lemma == nil then
				text = text .. ' <dl><dd>« [[:Κατηγορία:' .. catword .. ' ' .. affix .. ' (' .. languages[lang_iso].host_name .. ')]]</dd></dl>' 	
			else -- give a different affix for the host language 
				text = text .. ' <dl><dd>« [[:Κατηγορία:' .. catword .. ' ' .. host_lemma .. ' (' .. languages[lang_iso].host_name .. ')]]</dd></dl>' 
			end
		end -- close nohost
		end -- close if sublang


		-- cat b -- [[:Κατηγορία:Λέξεις με υποκοριστικά επίθημα -άκι (νέα ελληνικά)]]
			if other_cat ~= '' and other_cat ~= nil then
				if languages[lang_iso].sublang == true then
				if nohost == '1' then
					if sort == '' or sort == nil then
					cat = '[[Κατηγορία:Λέξεις ' .. in_cat .. ' (' .. lang_name .. ')|' .. other_cat .. ']]' .. "\n"	
					else
					cat = '[[Κατηγορία:Λέξεις ' .. in_cat .. ' (' .. lang_name .. ')|' .. sort .. ']]' ..  "\n"
					end
				else -- WITH host	
				if host_lemma == '' or host_lemma == nil then
					if sort == '' or sort == nil then
					cat = '[[Κατηγορία:' .. catword .. ' ' .. other_cat .. ' (' .. lang_name .. ')|' .. autosort .. ']]' .. "\n"
					.. '[[Κατηγορία:Λέξεις με επίθημα ' .. affix  .. ' (' .. lang_name .. ')| ' .. 'υποκοριστικα' .. ']]' ..  "\n" -- sort top
					.. '[[Κατηγορία:' .. catword .. ' ' .. affix  .. ' (' .. languages[lang_iso].host_name .. ')|' .. languages[lang_iso].key .. ']]' ..  "\n"
					else
					cat = '[[Κατηγορία:' .. catword .. ' ' .. other_cat .. ' (' .. lang_name .. ')|' .. sort .. ']]' .. "\n"
					.. '[[Κατηγορία:Λέξεις με επίθημα ' .. affix  .. ' (' .. lang_name .. ')| ' .. 'υποκοριστικα' .. ']]' ..  "\n" -- sort top
					.. '[[Κατηγορία:' .. catword .. ' ' .. affix .. ' (' .. languages[lang_iso].host_name .. ')|' .. languages[lang_iso].key .. ']]' ..  "\n"
					end
				else -- there is a different args['hostlemma']
					if sort == '' or sort == nil then
					cat = '[[Κατηγορία:' .. catword .. ' ' .. other_cat .. ' (' .. lang_name .. ')|' .. autosort .. ']]' .. "\n"
					.. '[[Κατηγορία:Λέξεις με επίθημα ' .. affix  .. ' (' .. lang_name .. ')| ' .. 'υποκοριστικα' .. ']]' ..  "\n" -- sort top
					.. '[[Κατηγορία:' .. catword .. ' ' .. host_lemma  .. ' (' .. languages[lang_iso].host_name .. ')|' .. languages[lang_iso].key .. ']]' ..  "\n"
					else
					cat = '[[Κατηγορία:' .. catword .. ' ' .. other_cat .. ' (' .. lang_name .. ')|' .. sort .. ']]' .. "\n"
					.. '[[Κατηγορία:Λέξεις με επίθημα ' .. affix  .. ' (' .. lang_name .. ')| ' .. 'υποκοριστικα' .. ']]' ..  "\n" -- sort top
					.. '[[Κατηγορία:' .. catword .. ' ' .. host_lemma .. ' (' .. languages[lang_iso].host_name .. ')|' .. languages[lang_iso].key .. ']]' ..  "\n"
					end
				end -- close if host_lemma
			end -- close nohost
			else -- no sublang
				if sort == '' or sort == nil then
				cat = '[[Κατηγορία:' .. catword .. ' ' .. other_cat .. ' (' .. lang_name .. ')|' .. autosort .. ']]' .. "\n"		
				else
				cat = '[[Κατηγορία:' .. catword .. ' ' .. other_cat .. ' (' .. lang_name .. ')|' .. sort .. ']]' .. "\n"
				end
			end -- close sublang
		

			else -- (no other_cat)   PLUS param nohost e.g. [[:Κατηγορία:Λέξεις με υποκοριστικό επίθημα -ίον (καθαρεύουσα)]] There is no -ιον for el. 
			if languages[lang_iso].sublang == true then
			if nohost == '1' then	
				if sort == '' or sort == nil then
				cat = '[[Κατηγορία:' .. cat_affix .. ' κατά υποκοριστικό επίθημα (' .. lang_name .. ')|' .. autosort .. ']]' ..  "\n"
				.. '[[Κατηγορία:Λέξεις με επίθημα ' .. affix .. ' (' .. lang_name .. ')| ' .. 'υποκοριστικα' .. ']]' .. "\n"	-- sort top	
				else
				cat = '[[Κατηγορία:' .. cat_affix .. ' κατά επίθημα (' .. lang_name .. ')|' .. sort .. ']]' ..  "\n"
				.. '[[Κατηγορία:Λέξεις με επίθημα ' .. affix .. ' (' .. lang_name .. ')| ' .. 'υποκοριστικα' .. ']]' ..  "\n" -- sort top
				end
			else -- WITH host
			if host_lemma == '' or host_lemma == nil then			
				if sort == '' or sort == nil then
				cat = '[[Κατηγορία:Λέξεις ' .. in_cat .. ' (' .. lang_name .. ')|' .. autosort .. ']]' .. "\n"	
				.. '[[Κατηγορία:Λέξεις με επίθημα ' .. affix  .. ' (' .. lang_name .. ')| ' .. 'υποκοριστικα' .. ']]' ..  "\n" -- sort top
				.. '[[Κατηγορία:' .. catword .. ' ' .. affix .. ' (' .. languages[lang_iso].host_name .. ')|' .. languages[lang_iso].key .. ']]' ..  "\n"
				else
				cat = '[[Κατηγορία:Λέξεις ' .. in_cat .. ' (' .. lang_name .. ')|' .. sort .. ']]' ..  "\n"
				.. '[[Κατηγορία:Λέξεις με επίθημα ' .. affix  .. ' (' .. lang_name .. ')| ' .. 'υποκοριστικα' .. ']]' ..  "\n" -- sort top
				.. '[[Κατηγορία:' .. catword .. ' ' .. affix .. ' (' .. languages[lang_iso].host_name .. ')|' .. languages[lang_iso].key .. ']]' ..  "\n"
				end
			else -- args['hostlemma'] is different
				if sort == '' or sort == nil then
				cat = '[[Κατηγορία:Λέξεις ' .. in_cat .. ' (' .. lang_name .. ')|' .. autosort .. ']]' .. "\n"	
				.. '[[Κατηγορία:Λέξεις με επίθημα ' .. affix  .. ' (' .. lang_name .. ')| ' .. 'υποκοριστικα' .. ']]' ..  "\n" -- sort top
				.. '[[Κατηγορία:' .. catword .. ' ' .. host_lemma .. ' (' .. languages[lang_iso].host_name .. ')|' .. languages[lang_iso].key .. ']]' ..  "\n"
				else
				cat = '[[Κατηγορία:Λέξεις ' .. in_cat .. ' (' .. lang_name .. ')|' .. sort .. ']]' ..  "\n"
				.. '[[Κατηγορία:Λέξεις με επίθημα ' .. affix  .. ' (' .. lang_name .. ')| ' .. 'υποκοριστικα' .. ']]' ..  "\n" -- sort top
				.. '[[Κατηγορία:' .. catword .. ' ' .. host_lemma .. ' (' .. languages[lang_iso].host_name .. ')|' .. languages[lang_iso].key .. ']]' ..  "\n"
				end
			end -- close host_lemma
			end -- close nohost
			else -- no sublang	
				if sort == '' or sort == nil then
				cat = '[[Κατηγορία:Λέξεις ' .. in_cat .. ' (' .. lang_name .. ')|' .. autosort .. ']]' .. "\n"	
				.. '[[Κατηγορία:Λέξεις με επίθημα ' .. affix  .. ' (' .. lang_name .. ')| ' .. 'υποκοριστικα' .. ']]' ..  "\n" -- sort top
				else
				cat = '[[Κατηγορία:Λέξεις ' .. in_cat .. ' (' .. lang_name .. ')|' .. sort .. ']]' ..  "\n"
				.. '[[Κατηγορία:Λέξεις με επίθημα ' .. affix  .. ' (' .. lang_name .. ')| ' .. 'υποκοριστικα' .. ']]' ..  "\n" -- sort top
				end
			end -- close sublang
		end -- close other_cat				
				

		if multicat ~= '' and multicat ~= nil then
			cat = cat .. '[[Κατηγορία:' .. cat_word .. ' ' .. affix .. '|' .. languages[lang_iso].key .. ']]' .. "\n"		
		end
		if cat_plus ~= '' and cat_plus ~= nil then
			cat = cat .. '[[Κατηγορία:' .. catword .. ' ' .. cat_plus .. ' (' .. lang_name .. ')| ]]' .. "\n" -- sort top
		end
		if multisense ~= '' and multisense ~= nil then
			cat = cat .. '[[Κατηγορία:' ..  catword_multisense .. ' (' .. lang_name .. ')|' .. multisense .. ']]' .. "\n"
		end
	end -- close cat_parenthesis
end -- close dim



-- =============== apply με μεγεθυντικό επίθημα -- with augmentative suffix [[:Κατηγορία:Λέξεις με μεγεθυντικό επίθημα -άκλα (νέα ελληνικά)]]
if mw.ustring.find(cat_title, "Λέξεις με μεγεθυντικό επίθημα")

then
-- a mode, no (language)
	if cat_parenthesis == '' or cat_parenthesis == nil then
		text = text_wikt .. ' » [[:Κατηγορία:Ετυμολογία|Ετυμολογία]] » [[:Κατηγορία:Μορφολογία|Μορφολογία]]'
		.. ' » [[:Κατηγορία:Προσφύματα|Προσφύματα]]'
		.. ' » [[:Κατηγορία:Επιθήματα|Επιθήματα]]'
		.. ' » [[:Κατηγορία:Μεγεθυντικά επιθήματα|' .. 'μεγεθυντικά' .. ']]'
		.. ' » [[:Κατηγορία:Λέξεις με επίθημα ' .. affix .. '|επίθημα]]'
		if show_other == '' or show_other == nil then
			text = text .. ' » [[' .. affix .. '|<b>' .. affix .. '</b>]]'
		else
			text = text  .. ' » [[' .. affix .. '|<b>' .. show_other .. '</b>]]' -- alt, show alternative
		end
		text = text .. ' « [[:Κατηγορία:Λέξεις ' .. 'κατά μεγεθυντικό επίθημα' .. '|Λέξεις ' .. 'κατά μεγεθυντικό επίθημα' .. ']]'
		
		
		-- cat a
		if sort == '' or sort == nil then
			cat = '[[Κατηγορία:' .. cat_affix .. ' κατά μεγεθυντικό επίθημα|' .. autosort .. ']]' ..  "\n"	
			.. '[[Κατηγορία:Λέξεις γλωσσών με κοινό μεγεθυντικό επίθημα|' .. autosort .. ']]' ..  "\n"			
		else
			cat = '[[Κατηγορία:' .. cat_affix .. ' κατά μεγεθυντικό επίθημα|' .. sort .. ']]' ..  "\n"	
			.. '[[Κατηγορία:Λέξεις γλωσσών με κοινό μεγεθυντικό επίθημα|' .. sort .. ']]' ..  "\n"
		end

	else -- with language
-- b mode e.g. [[:Κατηγορία:Λέξεις με μεγεθυντικό επίθημα -άκλα (νέα ελληνικά)]]  PLUS param nohost
		text = text_lang .. ' » [[:Κατηγορία:Ετυμολογία (' .. lang_name .. ')|Ετυμολογία]]'
		.. ' » [[:Κατηγορία:Μορφολογία (' .. lang_name .. ')|Μορφολογία]]'
		.. ' » [[:Κατηγορία:Προσφύματα (' .. lang_name .. ')|Προσφύματα]]'
		.. ' » [[:Κατηγορία:Επιθήματα (' .. lang_name .. ')|Επιθήματα]]'
		.. ' » [[:Κατηγορία:Μεγεθυντικά επιθήματα (' .. lang_name .. ')|' .. 'μεγεθυντικά' .. ']]'
		.. ' » [[:Κατηγορία:Λέξεις με επίθημα ' .. affix .. ' (' .. lang_name .. ')|με επίθημα]]'
		if other_lemma == '' or other_lemma == nil then
			if show_other == '' or show_other == nil then
			text = text .. ' » [[' .. affix .. "#" .. languages[lang_iso].link .. '|<b>' .. affix .. '</b>]]'
			else
			text = text .. ' » [[' .. affix .. "#" .. languages[lang_iso].link .. '|<b>' .. show_other .. '</b>]]'
			end
		else -- give a different link
			if show_other == '' or show_other == nil then
			text = text .. ' » [[' .. other_lemma .. "#" .. languages[lang_iso].link .. '|<b>' .. other_lemma .. '</b>]]'
			else
			text = text .. ' » [[' .. other_lemma .. "#" .. languages[lang_iso].link .. '|<b>' .. show_other .. '</b>]]'
			end
		end
		text = text .. ' « [[:Κατηγορία:Λέξεις κατά μεγεθυντικό επίθημα (' .. lang_name .. ')|Λέξεις ' .. 'κατά μεγεθυντικό επίθημα' .. ']]'
		if languages[lang_iso].sublang == true then
		if nohost == '1' then		
			text = text
		else -- no nohost
			if host_lemma == '' or host_lemma == nil then
				text = text .. ' <dl><dd>« [[:Κατηγορία:' .. catword .. ' ' .. affix .. ' (' .. languages[lang_iso].host_name .. ')]]</dd></dl>' 	
			else -- give a different affix for the host language 
				text = text .. ' <dl><dd>« [[:Κατηγορία:' .. catword .. ' ' .. host_lemma .. ' (' .. languages[lang_iso].host_name .. ')]]</dd></dl>' 
			end
		end -- close nohost
		end -- close if sublang
		-- cat b
			if other_cat ~= '' and other_cat ~= nil then
				if languages[lang_iso].sublang == true then
				if nohost == '1' then
					if sort == '' or sort == nil then
					cat = '[[Κατηγορία:Λέξεις ' .. in_cat .. ' (' .. lang_name .. ')|' .. other_cat .. ']]' .. "\n"	
					else
					cat = '[[Κατηγορία:Λέξεις ' .. in_cat .. ' (' .. lang_name .. ')|' .. sort .. ']]' ..  "\n"
					end
				else -- WITH host
				if host_lemma == '' or host_lemma == nil then
					if sort == '' or sort == nil then
					cat = '[[Κατηγορία:' .. catword .. ' ' .. other_cat .. ' (' .. lang_name .. ')|' .. autosort .. ']]' .. "\n"
					.. '[[Κατηγορία:Λέξεις με επίθημα ' .. affix  .. ' (' .. lang_name .. ')| ' .. 'μεγεθυντικα' .. ']]' ..  "\n" -- sort top
					.. '[[Κατηγορία:' .. catword .. ' ' .. affix  .. ' (' .. languages[lang_iso].host_name .. ')|' .. languages[lang_iso].key .. ']]' ..  "\n"
					else
					cat = '[[Κατηγορία:' .. catword .. ' ' .. other_cat .. ' (' .. lang_name .. ')|' .. sort .. ']]' .. "\n"
					.. '[[Κατηγορία:Λέξεις με επίθημα ' .. affix  .. ' (' .. lang_name .. ')| ' .. 'μεγεθυντικα' .. ']]' ..  "\n" -- sort top
					.. '[[Κατηγορία:' .. catword .. ' ' .. affix .. ' (' .. languages[lang_iso].host_name .. ')|' .. languages[lang_iso].key .. ']]' ..  "\n"
					end
				else -- there is a different args['hostlemma']
					if sort == '' or sort == nil then
					cat = '[[Κατηγορία:' .. catword .. ' ' .. other_cat .. ' (' .. lang_name .. ')|' .. autosort .. ']]' .. "\n"
					.. '[[Κατηγορία:Λέξεις με επίθημα ' .. affix  .. ' (' .. lang_name .. ')| ' .. 'μεγεθυντικα' .. ']]' ..  "\n" -- sort top
					.. '[[Κατηγορία:' .. catword .. ' ' .. host_lemma  .. ' (' .. languages[lang_iso].host_name .. ')|' .. languages[lang_iso].key .. ']]' ..  "\n"
					else
					cat = '[[Κατηγορία:' .. catword .. ' ' .. other_cat .. ' (' .. lang_name .. ')|' .. sort .. ']]' .. "\n"
					.. '[[Κατηγορία:Λέξεις με επίθημα ' .. affix  .. ' (' .. lang_name .. ')| ' .. 'μεγεθυντικα' .. ']]' ..  "\n" -- sort top
					.. '[[Κατηγορία:' .. catword .. ' ' .. host_lemma .. ' (' .. languages[lang_iso].host_name .. ')|' .. languages[lang_iso].key .. ']]' ..  "\n"
					end
				end -- close if host_lemma
			end -- close nohost
			else -- no sublang
				if sort == '' or sort == nil then
				cat = '[[Κατηγορία:' .. catword .. ' ' .. other_cat .. ' (' .. lang_name .. ')|' .. autosort .. ']]' .. "\n"		
				else
				cat = '[[Κατηγορία:' .. catword .. ' ' .. other_cat .. ' (' .. lang_name .. ')|' .. sort .. ']]' .. "\n"
				end
			end -- close sublang
		

			else -- (no other_cat)   PLUS param nohost					
			if languages[lang_iso].sublang == true then
			if nohost == '1' then	
				if sort == '' or sort == nil then
				cat = '[[Κατηγορία:' .. cat_affix .. ' κατά μεγεθυντικό επίθημα (' .. lang_name .. ')|' .. autosort .. ']]' ..  "\n"
				.. '[[Κατηγορία:Λέξεις με επίθημα ' .. affix .. ' (' .. lang_name .. ')| ' .. 'μεγεθυντικα' .. ']]' .. "\n"	-- sort top	
				else
				cat = '[[Κατηγορία:' .. cat_affix .. ' κατά επίθημα (' .. lang_name .. ')|' .. sort .. ']]' ..  "\n"
				.. '[[Κατηγορία:Λέξεις με επίθημα ' .. affix .. ' (' .. lang_name .. ')| ' .. 'μεγεθυντικα' .. ']]' ..  "\n" -- sort top
				end
			else -- WITH host
			if host_lemma == '' or host_lemma == nil then			
				if sort == '' or sort == nil then
				cat = '[[Κατηγορία:Λέξεις ' .. in_cat .. ' (' .. lang_name .. ')|' .. autosort .. ']]' .. "\n"	
				.. '[[Κατηγορία:Λέξεις με επίθημα ' .. affix  .. ' (' .. lang_name .. ')| ' .. 'μεγεθυντικα' .. ']]' ..  "\n" -- sort top
				.. '[[Κατηγορία:' .. catword .. ' ' .. affix .. ' (' .. languages[lang_iso].host_name .. ')|' .. languages[lang_iso].key .. ']]' ..  "\n"
				else
				cat = '[[Κατηγορία:Λέξεις ' .. in_cat .. ' (' .. lang_name .. ')|' .. sort .. ']]' ..  "\n"
				.. '[[Κατηγορία:Λέξεις με επίθημα ' .. affix  .. ' (' .. lang_name .. ')| ' .. 'μεγεθυντικα' .. ']]' ..  "\n" -- sort top
				.. '[[Κατηγορία:' .. catword .. ' ' .. affix .. ' (' .. languages[lang_iso].host_name .. ')|' .. languages[lang_iso].key .. ']]' ..  "\n"
				end
			else -- args['hostlemma'] is different
				if sort == '' or sort == nil then
				cat = '[[Κατηγορία:Λέξεις ' .. in_cat .. ' (' .. lang_name .. ')|' .. autosort .. ']]' .. "\n"	
				.. '[[Κατηγορία:Λέξεις με επίθημα ' .. affix  .. ' (' .. lang_name .. ')| ' .. 'μεγεθυντικα' .. ']]' ..  "\n" -- sort top
				.. '[[Κατηγορία:' .. catword .. ' ' .. host_lemma .. ' (' .. languages[lang_iso].host_name .. ')|' .. languages[lang_iso].key .. ']]' ..  "\n"
				else
				cat = '[[Κατηγορία:Λέξεις ' .. in_cat .. ' (' .. lang_name .. ')|' .. sort .. ']]' ..  "\n"
				.. '[[Κατηγορία:Λέξεις με επίθημα ' .. affix  .. ' (' .. lang_name .. ')| ' .. 'μεγεθυντικα' .. ']]' ..  "\n" -- sort top
				.. '[[Κατηγορία:' .. catword .. ' ' .. host_lemma .. ' (' .. languages[lang_iso].host_name .. ')|' .. languages[lang_iso].key .. ']]' ..  "\n"
				end
			end -- close host_lemma
			end -- close nohost
			else -- no sublang	
				if sort == '' or sort == nil then
				cat = '[[Κατηγορία:Λέξεις ' .. in_cat .. ' (' .. lang_name .. ')|' .. autosort .. ']]' .. "\n"	
				.. '[[Κατηγορία:Λέξεις με επίθημα ' .. affix  .. ' (' .. lang_name .. ')| ' .. 'μεγεθυντικα' .. ']]' ..  "\n" -- sort top
				else
				cat = '[[Κατηγορία:Λέξεις ' .. in_cat .. ' (' .. lang_name .. ')|' .. sort .. ']]' ..  "\n"
				.. '[[Κατηγορία:Λέξεις με επίθημα ' .. affix  .. ' (' .. lang_name .. ')| ' .. 'μεγεθυντικα' .. ']]' ..  "\n" -- sort top
				end
			end -- close sublang
		end -- close other_cat					

		if multicat ~= '' and multicat ~= nil then
			cat = cat .. '[[Κατηγορία:' .. cat_word .. ' ' .. affix .. '|' .. languages[lang_iso].key .. ']]' .. "\n"		
		end
		if cat_plus ~= '' and cat_plus ~= nil then
			cat = cat .. '[[Κατηγορία:' .. catword .. ' ' .. cat_plus .. ' (' .. lang_name .. ')| ]]' .. "\n" -- sort top
		end
		if multisense ~= '' and multisense ~= nil then
			cat = cat .. '[[Κατηγορία:' ..  catword_multisense .. ' (' .. lang_name .. ')|' .. multisense .. ']]' .. "\n"
		end
	end -- close cat_parenthesis
end -- close  aug




--------------------------------------------------------------------------
--                        ΚΥΡΙΑ ΟΝΟΜΑΤΑ                                 --
--         with PREFIX (or combining) - with SUFFIX (or combining)      --
--                      for names, surnames
--------------------------------------------------------------------------
-- ============== πρόθημα prefix  + ανδρικά/γυναικεία ονόματα/επώνυμα / τοπωνύμια ================
-- εντάσσονται στο πρόθημα με μικρό και όχι κεφαλαίο (Λέξεις με πρόθημα ωωω-)
-- [[:Κατηγορία:Ανδρικά επώνυμα με πρόθημα Δελη- (νέα ελληνικά)]] -- CHECK [[:Κατηγορία:Ανδρικά επώνυμα κατά πρόθημα (νέα ελληνικά)]]
	if mw.ustring.find(cat_title, "Ανδρικά ονόματα με πρόθημα") or mw.ustring.find(cat_title, "Ανδρικά ονόματα κατά πρόθημα")  then catword = 'Ανδρικά ονόματα' catwordkey = 'α' end
	if mw.ustring.find(cat_title, "Ανδρικά επώνυμα με πρόθημα") or mw.ustring.find(cat_title, "Ανδρικά επώνυμα κατά πρόθημα") then catword = 'Ανδρικά επώνυμα' catwordkey = 'α' end
	if mw.ustring.find(cat_title, "Γυναικεία ονόματα με πρόθημα") or mw.ustring.find(cat_title, "Γυναικεία ονόματα κατά πρόθημα")  then catword = 'Γυναικεία ονόματα' catwordkey = 'γ' end
	if mw.ustring.find(cat_title, "Γυναικεία επώνυμα με πρόθημα") or mw.ustring.find(cat_title, "Γυναικεία επώνυμα κατά πρόθημα")  then catword = 'Γυναικεία επώνυμα' catwordkey = 'γ' end
	if mw.ustring.find(cat_title, "Ονόματα κοινού γένους με πρόθημα") or mw.ustring.find(cat_title, "Ονόματα κοινού γένους κατά πρόθημα")  then catword = 'Ονόματα κοινού γένους' catwordkey = 'κ' end
	if mw.ustring.find(cat_title, "Επώνυμα κοινού γένους με πρόθημα") or mw.ustring.find(cat_title, "Επώνυμα κοινού γένους κατά πρόθημα")  then catword = 'Επώνυμα κοινού γένους' catwordkey = 'κ' end
	if mw.ustring.find(cat_title, "Τοπωνύμια με πρόθημα") or mw.ustring.find(cat_title, "Τοπωνύμια κατά πρόθημα")  then catword = 'Τοπωνύμια' catwordkey = 'τ' end
	
	if mw.ustring.find(cat_title, "Ανδρικά ονόματα με πρόθημα") or mw.ustring.find(cat_title, "Ανδρικά επώνυμα με πρόθημα")
	or mw.ustring.find(cat_title, "Γυναικεία ονόματα με πρόθημα") or mw.ustring.find(cat_title, "Γυναικεία επώνυμα με πρόθημα")
	or mw.ustring.find(cat_title, "Ονόματα κοινού γένους με πρόθημα") or mw.ustring.find(cat_title, "Επώνυμα κοινού γένους με πρόθημα")
	or mw.ustring.find(cat_title, "Τοπωνύμια με πρόθημα")
	then
-- a mode, no (language) -- there are no such categories at the moment
		if cat_parenthesis == '' or cat_parenthesis == nil then
			text = text_wikt .. ' » [[:Κατηγορία:Ετυμολογία|Ετυμολογία]] » [[:Κατηγορία:Μορφολογία|Μορφολογία]]'
			if compound ~= '' and compound ~=  nil then
				text = text .. ' » [[:Κατηγορία:Σύνθετα|Σύνθετα]]'
				.. " » [[:Κατηγορία:Λέξεις με συνθετικό '" .. compound .. "'|Λέξεις με συνθετικό]]"
				.. " » [[" .. compound .. "|<b>" .. compound .. "</b>]]"
			else
			text = text .. ' » [[:Κατηγορία:Προσφύματα|Προσφύματα]]'		
			 .. ' » [[:Κατηγορία:Προθήματα|Προθήματα]]'

	-- a free edit 
			if other_link ~= '' and other_link ~=  nil then
				text = text	.. ' » ' .. other_link
			else
				text = text .. ' » [[:Κατηγορία:Λέξεις με πρόθημα ' 
				.. mw.getContentLanguage():lcfirst(mw.ustring.sub(mw.ustring.match(cat_title, catword .. " με πρόθημα (.*)"), 1, -1))  
				..  '|Λέξεις με πρόθημα]] ' 
			if other_lemma ~= '' and other_lemma ~= nil then text = text .. other_lemma else	
				text = text .. '[[' .. mw.getContentLanguage():lcfirst(mw.ustring.sub(mw.ustring.match(cat_title, catword .. " με πρόθημα (.*)"), 1, -1)) 
				..  "|"
				if show_other == '' or show_other == nil then
				text = text .. '<b>' .. mw.getContentLanguage():lcfirst(mw.ustring.sub(mw.ustring.match(cat_title, catword .. " με πρόθημα (.*)"), 1, -1)) .. '</b>]]'
				else
				text = text .. '<b>' .. show_other .. '</b>]]'
				end	
			end
			end -- close other link
			end -- close compound
				text = text .. ' « [[:Κατηγορία:' .. catword .. ' κατά πρόθημα|' .. catword .. ' κατά πρόθημα]]'
			
-- $## autosort?
			-- cat a
			if other_cat ~= '' and other_cat ~= nil then
				if sort == '' or sort == nil then
				mw.addWarning('<b><span style="color:#b22222; font-size:20px;">Συμπληρώστε με &#123;&#123;auto cat|xxx}} την κλείδα κατάταξης sort.</span></b>')
				cat = '[[Κατηγορία:Σελίδες με σφάλμα στο auto cat]]'
				else
				cat = '[[Κατηγορία:Λέξεις με πρόθημα ' .. other_cat  ..  '|' .. catword .. ']]' ..  "\n"
				.. '[[Κατηγορία:' .. catword .. ' κατά πρόθημα|' .. sort .. ']]' ..  "\n"
				end
			else -- (no other cat)
				if sort == '' or sort == nil then
				mw.addWarning('<b><span style="color:#b22222; font-size:20px;">Συμπληρώστε με &#123;&#123;auto cat|xxx}} την κλείδα κατάταξης sort.</span></b>')
				cat = '[[Κατηγορία:Σελίδες με σφάλμα στο auto cat]]'
				else
				cat = '[[Κατηγορία:Λέξεις με πρόθημα ' 
				.. mw.getContentLanguage():lcfirst(mw.ustring.sub(mw.ustring.match(cat_title, catword .. " με πρόθημα (.*)"), 1, -1))  .. '|' .. catword .. ']]' ..  "\n"
				.. '[[Κατηγορία:' .. catword .. ' κατά πρόθημα|' .. sort .. ']]' ..  "\n"
				end
			end

		if compound ~= '' and compound ~=  nil then	
			cat = cat .. "[[Κατηγορία:Λέξεις με συνθετικό '" .. compound .. "'|" .. sort .. ']]'
		end

		else -- with language
			
-- $## ?? no multicat here?
-- b mode e.g. [[:Κατηγορία:Ανδρικά επώνυμα με πρόθημα Δελη- (νέα ελληνικά)]] -- CHECK [[:Κατηγορία:Ανδρικά επώνυμα κατά πρόθημα (νέα ελληνικά)]]
			text = text_lang .. ' » [[:Κατηγορία:Ετυμολογία (' .. lang_name .. ')|Ετυμολογία]]'
			.. ' » [[:Κατηγορία:Μορφολογία (' .. lang_name .. ')|Μορφολογία]]'
			-- [[:Κατηγορία:Ανδρικά ονόματα με πρόθημα Αγγελ- (νέα ελληνικά)]]
			if compound ~= '' and compound ~=  nil then
				text = text .. ' » [[:Κατηγορία:Σύνθετα (' .. lang_name .. ')|Σύνθετα]]'
				.. " » [[:Κατηγορία:Λέξεις με συνθετικό '" .. compound .. "' (" .. lang_name .. ")|Λέξεις με συνθετικό]]"
				.. " » [[" .. compound .. "#" .. languages[lang_iso].link .. "|<b>" .. compound .. "</b>]]"
			
			else
			text = text .. ' » [[:Κατηγορία:Προσφύματα (' .. lang_name .. ')|Προσφύματα]]'
			.. ' » [[:Κατηγορία:Προθήματα (' .. lang_name .. ')|Προθήματα]]'

			-- b free edit
			if other_link ~= '' and other_link ~=  nil then
				text = text	.. ' » ' .. other_link
			
			else
				text = text .. ' » [[:Κατηγορία:Λέξεις με πρόθημα ' 
				.. mw.getContentLanguage():lcfirst(mw.ustring.sub(mw.ustring.match(cat_title, catword .. " με πρόθημα (.*)"), 1, -1))  
				..  ' (' .. lang_name .. ')|Λέξεις με πρόθημα]] ' 
		-- do as in previous: Λέξεις με πρόθημα...	where affix is 	mw.getContentLanguage():lcfirst(mw...........
		if other_lemma == '' or other_lemma == nil then
			if show_other == '' or show_other == nil then
			text = text .. ' » [[' .. mw.getContentLanguage():lcfirst(mw.ustring.sub(mw.ustring.match(cat_title, catword .. " με πρόθημα (.*)"), 1, -1)) .. "#" .. languages[lang_iso].link .. '|<b>' .. mw.getContentLanguage():lcfirst(mw.ustring.sub(mw.ustring.match(cat_title, catword .. " με πρόθημα (.*)"), 1, -1)) .. '</b>]]'
			else
			text = text .. ' » [[' .. mw.getContentLanguage():lcfirst(mw.ustring.sub(mw.ustring.match(cat_title, catword .. " με πρόθημα (.*)"), 1, -1)) .. "#" .. languages[lang_iso].link .. '|<b>' .. show_other .. '</b>]]'
			end
		else -- give a different link
			if show_other == '' or show_other == nil then
			text = text .. ' » [[' .. other_lemma .. "#" .. languages[lang_iso].link .. '|<b>' .. other_lemma .. '</b>]]'
			else
			text = text .. ' » [[' .. other_lemma .. "#" .. languages[lang_iso].link .. '|<b>' .. show_other .. '</b>]]'
			end
		end			
				
				
			 
			end -- close other link
			end -- close compound
				text = text .. ' « [[:Κατηγορία:' .. catword .. ' κατά πρόθημα (' .. lang_name .. ')|' .. catword .. ' κατά πρόθημα]]'
			

			-- cat b
-- here, autosort = take off the hyphen at end: autosort  = mw.getContentLanguage():lcfirst(mw.ustring.sub(mw.ustring.match(cat_title, catword .. " με πρόθημα (.*)"), 1, -2))			
	-- and 	m_utilities.sortkey(	
			if compound ~= '' and compound ~=  nil then	-- [[:Κατηγορία:Ανδρικά ονόματα με πρόθημα Ἀμφι- (αρχαία ελληνικά)]]
				if sort == '' or sort == nil then
				cat = cat .. "[[Κατηγορία:Λέξεις με συνθετικό '" .. compound .. "' (" .. lang_name .. ')|' 
				.. m_utilities.sortkey(mw.getContentLanguage():lcfirst(mw.ustring.sub(mw.ustring.match(cat_title, catword .. " με πρόθημα (.*)"), 1, -2))) .. ']]'	
				.. '[[Κατηγορία:' .. catword .. ' κατά πρόθημα (' .. lang_name .. ')|' 
				.. m_utilities.sortkey(mw.getContentLanguage():lcfirst(mw.ustring.sub(mw.ustring.match(cat_title, catword .. " με πρόθημα (.*)"), 1, -2))) .. ']]'
				else
				cat = cat .. "[[Κατηγορία:Λέξεις με συνθετικό '" .. compound .. "' (" .. lang_name .. ')|' .. sort .. ']]'
				.. '[[Κατηγορία:' .. catword .. ' κατά πρόθημα (' .. lang_name .. ')|' .. sort .. ']]'
				end
			else
	
			if other_cat ~= '' and other_cat ~= nil then
				if sort == '' or sort == nil then
--				mw.addWarning('<b><span style="color:#b22222; font-size:14px;">Αν χρειάζεται, συμπληρώστε με &#123;&#123;auto cat|xxx}} την κλείδα κατάταξης sort.</span></b>')
				cat = '[[Κατηγορία:Λέξεις με πρόθημα ' .. other_cat  ..  ' (' .. lang_name .. ')|' .. catword .. ']]' ..  "\n"
				.. '[[Κατηγορία:' .. catword .. ' κατά πρόθημα (' .. lang_name .. ')|' 
				.. m_utilities.sortkey(mw.getContentLanguage():lcfirst(mw.ustring.sub(mw.ustring.match(cat_title, catword .. " με πρόθημα (.*)"), 1, -2))) .. ']]' ..  "\n"
				else
				cat = '[[Κατηγορία:Λέξεις με πρόθημα ' .. other_cat  ..  ' (' .. lang_name .. ')|' .. catwordkey .. ']]' ..  "\n"
				.. '[[Κατηγορία:' .. catword .. ' κατά πρόθημα (' .. lang_name .. ')|' .. sort .. ']]' ..  "\n"
				end
			else -- (no other cat)
				if sort == '' or sort == nil then
--				mw.addWarning('<b><span style="color:#b22222; font-size:14px;">Αν χρειάζεται, συμπληρώστε με &#123;&#123;auto cat|xxx}} την κλείδα κατάταξης sort.</span></b>')
				cat = '[[Κατηγορία:Λέξεις με πρόθημα ' 
				.. mw.getContentLanguage():lcfirst(mw.ustring.sub(mw.ustring.match(cat_title, catword .. " με πρόθημα (.*)"), 1, -1)) 
				..  ' (' .. lang_name .. ')|' .. catwordkey .. ']]' ..  "\n"

				.. '[[Κατηγορία:' .. catword .. ' κατά πρόθημα (' .. lang_name .. ')|' 
				.. m_utilities.sortkey(mw.getContentLanguage():lcfirst(mw.ustring.sub(mw.ustring.match(cat_title, catword .. " με πρόθημα (.*)"), 1, -2))) .. ']]' ..  "\n"
				else
				cat = '[[Κατηγορία:Λέξεις με πρόθημα ' .. mw.getContentLanguage():lcfirst(mw.ustring.sub(mw.ustring.match(cat_title, catword .. " με πρόθημα (.*)"), 1, -1))  
				..  ' (' .. lang_name .. ')|' .. catwordkey .. ']]' ..  "\n"
				.. '[[Κατηγορία:' .. catword .. ' κατά πρόθημα (' .. lang_name .. ')|' .. sort .. ']]' ..  "\n"
				end
			end


		end -- close compound category
		
		end -- close cat_parenthesis
	end -- close names+πρόθημα prefix


-- ============== επίθημα suffix + ανδρικά/γυναικεία ονόματα/επώνυμα ================
-- [[:Κατηγορία:Ανδρικά επώνυμα με επίθημα -άρης (νέα ελληνικά)]] -- CHECK [[:Κατηγορία:Ανδρικά επώνυμα κατά επίθημα (νέα ελληνικά)]]
	if mw.ustring.find(cat_title, "Ανδρικά ονόματα με επίθημα") or mw.ustring.find(cat_title, "Ανδρικά ονόματα κατά επίθημα")  then catword = 'Ανδρικά ονόματα' catwordkey = 'α' end
	if mw.ustring.find(cat_title, "Ανδρικά επώνυμα με επίθημα") or mw.ustring.find(cat_title, "Ανδρικά επώνυμα κατά επίθημα") then catword = 'Ανδρικά επώνυμα' catwordkey = 'α' end
	if mw.ustring.find(cat_title, "Γυναικεία ονόματα με επίθημα") or mw.ustring.find(cat_title, "Γυναικεία ονόματα κατά επίθημα")  then catword = 'Γυναικεία ονόματα' catwordkey = 'γ' end
	if mw.ustring.find(cat_title, "Γυναικεία επώνυμα με επίθημα") or mw.ustring.find(cat_title, "Γυναικεία επώνυμα κατά επίθημα")  then catword = 'Γυναικεία επώνυμα' catwordkey = 'γ' end
	if mw.ustring.find(cat_title, "Ονόματα κοινού γένους με επίθημα") or mw.ustring.find(cat_title, "Ονόματα κοινού γένους κατά επίθημα")  then catword = 'Ονόματα κοινού γένους' catwordkey = 'κ' end
	if mw.ustring.find(cat_title, "Επώνυμα κοινού γένους με επίθημα") or mw.ustring.find(cat_title, "Επώνυμα κοινού γένους κατά επίθημα")  then catword = 'Επώνυμα κοινού γένους' catwordkey = 'κ' end
	if mw.ustring.find(cat_title, "Τοπωνύμια με επίθημα") or mw.ustring.find(cat_title, "Τοπωνύμια κατά επίθημα")  then catword = 'Τοπωνύμια' catwordkey = 'τ' end
	
	if mw.ustring.find(cat_title, "Ανδρικά ονόματα με επίθημα") or mw.ustring.find(cat_title, "Ανδρικά επώνυμα με επίθημα")
	or mw.ustring.find(cat_title, "Γυναικεία ονόματα με επίθημα") or mw.ustring.find(cat_title, "Γυναικεία επώνυμα με επίθημα")
	or mw.ustring.find(cat_title, "Ονόματα κοινού γένους με επίθημα") or mw.ustring.find(cat_title, "Επώνυμα κοινού γένους με επίθημα")
	or mw.ustring.find(cat_title, "Τοπωνύμια με επίθημα")
	then
		
		
-- a mode, no (language) -- there are no such categories at the moment
		if cat_parenthesis == '' or cat_parenthesis == nil then
			text = text_wikt .. ' » [[:Κατηγορία:Ετυμολογία|Ετυμολογία]] » [[:Κατηγορία:Μορφολογία|Μορφολογία]]'
			if compound ~= '' and compound ~=  nil then
				text = text .. ' » [[:Κατηγορία:Σύνθετα|Σύνθετα]]'
				.. " » [[:Κατηγορία:Λέξεις με συνθετικό '" .. compound .. "'|Λέξεις με συνθετικό]]"
				.. " » [[" .. compound .. "|<b>" .. compound .. "</b>]]"
			else
			text = text .. ' » [[:Κατηγορία:Προσφύματα|Προσφύματα]]'		
			 .. ' » [[:Κατηγορία:Επιθήματα|Επιθήματα]]'

	-- a free edit 
			if other_link ~= '' and other_link ~=  nil then
				text = text	.. ' » ' .. other_link
			else
				text = text .. ' » [[:Κατηγορία:Λέξεις με επίθημα ' 
				.. mw.getContentLanguage():lcfirst(mw.ustring.sub(mw.ustring.match(cat_title, catword .. " με επίθημα (.*)"), 1, -1))  
				..  '|Λέξεις με επίθημα]] ' 
			if other_lemma ~= '' and other_lemma ~= nil then text = text .. other_lemma else	
				text = text .. '[[' .. mw.getContentLanguage():lcfirst(mw.ustring.sub(mw.ustring.match(cat_title, catword .. " με επίθημα (.*)"), 1, -1)) 
				..  "|"
				if show_other == '' or show_other == nil then
				text = text .. '<b>' .. mw.getContentLanguage():lcfirst(mw.ustring.sub(mw.ustring.match(cat_title, catword .. " με επίθημα (.*)"), 1, -1)) .. '</b>]]'
				else
				text = text .. '<b>' .. show_other .. '</b>]]'
				end	
			end
			end -- close other link
			end -- close compound
				text = text .. ' « [[:Κατηγορία:' .. catword .. ' κατά επίθημα|' .. catword .. ' κατά επίθημα]]'

-- ## NEEDS CHECKING
			-- cat a
			if other_cat ~= '' and other_cat ~= nil then
				if sort == '' or sort == nil then
--				mw.addWarning('<b><span style="color:#b22222; font-size:20px;">Συμπληρώστε με &#123;&#123;auto cat|xxx}} την κλείδα κατάταξης sort.</span></b>')
				cat = '[[Κατηγορία:Σελίδες με σφάλμα στο auto cat]]'
				else
				cat = '[[Κατηγορία:Λέξεις με επίθημα ' .. other_cat  ..  '|' .. catword .. ']]' ..  "\n"
				.. '[[Κατηγορία:' .. catword .. ' κατά επίθημα|' .. sort .. ']]' ..  "\n"
				end
			else -- (no other cat)
				if sort == '' or sort == nil then
--				mw.addWarning('<b><span style="color:#b22222; font-size:20px;">Συμπληρώστε με &#123;&#123;auto cat|xxx}} την κλείδα κατάταξης sort.</span></b>')
				cat = '[[Κατηγορία:Σελίδες με σφάλμα στο auto cat]]'
				else
				cat = '[[Κατηγορία:Λέξεις με επίθημα ' 
				.. m_utilities.sortkey(mw.getContentLanguage():lcfirst(mw.ustring.sub(mw.ustring.match(cat_title, catword .. " με επίθημα (.*)"), 1, -1)))  .. '|' .. catword .. ']]' ..  "\n"
				.. '[[Κατηγορία:' .. catword .. ' κατά επίθημα|' .. sort .. ']]' ..  "\n"
				end
			end

		if compound ~= '' and compound ~=  nil then	
			cat = cat .. "[[Κατηγορία:Λέξεις με συνθετικό '" .. compound .. "'|" .. sort .. ']]'
		end

		else -- with language
			
-- $## ?? no multicat here?	[[:Κατηγορία:Ανδρικά επώνυμα με επίθημα -άρχης (νέα ελληνικά)]]					
-- b mode
			text = text_lang .. ' » [[:Κατηγορία:Ετυμολογία (' .. lang_name .. ')|Ετυμολογία]]'
			.. ' » [[:Κατηγορία:Μορφολογία (' .. lang_name .. ')|Μορφολογία]]'
			if compound ~= '' and compound ~=  nil then
				text = text .. ' » [[:Κατηγορία:Σύνθετα (' .. lang_name .. ')|Σύνθετα]]'
				.. " » [[:Κατηγορία:Λέξεις με συνθετικό '" .. compound .. "' (" .. lang_name .. ")|Λέξεις με συνθετικό]]"
				.. " » [[" .. compound .. "#" .. languages[lang_iso].link .. "|<b>" .. compound .. "</b>]]"
			
			else
			text = text .. ' » [[:Κατηγορία:Προσφύματα (' .. lang_name .. ')|Προσφύματα]]'
			.. ' » [[:Κατηγορία:Επιθήματα (' .. lang_name .. ')|Επιθήματα]]'

			-- b free edit
			if other_link ~= '' and other_link ~=  nil then
				text = text	.. ' » ' .. other_link
			
			else
				text = text .. ' » [[:Κατηγορία:Λέξεις με επίθημα ' 
				.. mw.getContentLanguage():lcfirst(mw.ustring.sub(mw.ustring.match(cat_title, catword .. " με επίθημα (.*)"), 1, -1))  
				..  ' (' .. lang_name .. ')|Λέξεις με επίθημα]] ' 
		-- do as in previous:  where affix is 	mw.getContentLanguage():lcfirst(mw...........
		if other_lemma == '' or other_lemma == nil then
			if show_other == '' or show_other == nil then
			text = text .. ' » [[' .. mw.getContentLanguage():lcfirst(mw.ustring.sub(mw.ustring.match(cat_title, catword .. " με επίθημα (.*)"), 1, -1)) .. "#" .. languages[lang_iso].link .. '|<b>' .. mw.getContentLanguage():lcfirst(mw.ustring.sub(mw.ustring.match(cat_title, catword .. " με επίθημα (.*)"), 1, -1)) .. '</b>]]'
			else
			text = text .. ' » [[' .. mw.getContentLanguage():lcfirst(mw.ustring.sub(mw.ustring.match(cat_title, catword .. " με επίθημα (.*)"), 1, -1)) .. "#" .. languages[lang_iso].link .. '|<b>' .. show_other .. '</b>]]'
			end
		else -- give a different link
			if show_other == '' or show_other == nil then
			text = text .. ' » [[' .. other_lemma .. "#" .. languages[lang_iso].link .. '|<b>' .. other_lemma .. '</b>]]'
			else
			text = text .. ' » [[' .. other_lemma .. "#" .. languages[lang_iso].link .. '|<b>' .. show_other .. '</b>]]'
			end
		end			
				
				
			 
			end -- close other link
			end -- close compound
				text = text .. ' « [[:Κατηγορία:' .. catword .. ' κατά επίθημα (' .. lang_name .. ')|' .. catword .. ' κατά επίθημα]]'
			

			-- cat b
-- here, autosort = take off the hyphen at beginning: autosort  = mw.getContentLanguage():lcfirst(mw.ustring.sub(mw.ustring.match(cat_title, catword .. " με επίθημα (.*)"), 2, -1))			

			if compound ~= '' and compound ~=  nil then
				if sort == '' or sort == nil then
				cat = cat .. "[[Κατηγορία:Λέξεις με συνθετικό '" .. compound .. "' (" .. lang_name .. ')|' 
				.. m_utilities.sortkey(mw.getContentLanguage():lcfirst(mw.ustring.sub(mw.ustring.match(cat_title, catword .. " με επίθημα (.*)"), 2, -1))) .. ']]'	
				.. '[[Κατηγορία:' .. catword .. ' κατά επίθημα (' .. lang_name .. ')|' 
				.. m_utilities.sortkey(mw.getContentLanguage():lcfirst(mw.ustring.sub(mw.ustring.match(cat_title, catword .. " με επίθημα (.*)"), 2, -1))) .. ']]'
				else
				cat = cat .. "[[Κατηγορία:Λέξεις με συνθετικό '" .. compound .. "' (" .. lang_name .. ')|' .. sort .. ']]'
				.. '[[Κατηγορία:' .. catword .. ' κατά επίθημα (' .. lang_name .. ')|' .. sort .. ']]'
				end
			else
	
			if other_cat ~= '' and other_cat ~= nil then
				if sort == '' or sort == nil then
--				mw.addWarning('<b><span style="color:#b22222; font-size:14px;">Αν χρειάζεται, συμπληρώστε με &#123;&#123;auto cat|xxx}} την κλείδα κατάταξης sort.</span></b>')
				cat = '[[Κατηγορία:Λέξεις με επίθημα ' .. other_cat  ..  ' (' .. lang_name .. ')|' .. catwordkey .. ']]' ..  "\n"
				.. '[[Κατηγορία:' .. catword .. ' κατά επίθημα (' .. lang_name .. ')|' 
				.. m_utilities.sortkey(mw.getContentLanguage():lcfirst(mw.ustring.sub(mw.ustring.match(cat_title, catword .. " με επίθημα (.*)"), 2, -1))) .. ']]' ..  "\n"
				else
				cat = '[[Κατηγορία:Λέξεις με επίθημα ' .. other_cat  ..  ' (' .. lang_name .. ')|' .. catwordkey .. ']]' ..  "\n"
				.. '[[Κατηγορία:' .. catword .. ' κατά επίθημα (' .. lang_name .. ')|' .. sort .. ']]' ..  "\n"
				end
			else -- (no other cat)
				if sort == '' or sort == nil then
--				mw.addWarning('<b><span style="color:#b22222; font-size:14px;">Αν χρειάζεται, συμπληρώστε με &#123;&#123;auto cat|xxx}} την κλείδα κατάταξης sort.</span></b>')
				cat = '[[Κατηγορία:Λέξεις με επίθημα ' .. mw.getContentLanguage():lcfirst(mw.ustring.sub(mw.ustring.match(cat_title, catword .. " με επίθημα (.*)"), 1, -1))  
				..  ' (' .. lang_name .. ')|' .. catwordkey .. ']]' ..  "\n"

				.. '[[Κατηγορία:' .. catword .. ' κατά επίθημα (' .. lang_name .. ')|' 
				.. m_utilities.sortkey(mw.getContentLanguage():lcfirst(mw.ustring.sub(mw.ustring.match(cat_title, catword .. " με επίθημα (.*)"), 2, -1))) .. ']]' ..  "\n"
				else
				cat = '[[Κατηγορία:Λέξεις με επίθημα ' .. mw.getContentLanguage():lcfirst(mw.ustring.sub(mw.ustring.match(cat_title, catword .. " με επίθημα (.*)"), 1, -1))  
				..  ' (' .. lang_name .. ')|' .. catwordkey .. ']]' ..  "\n"
				.. '[[Κατηγορία:' .. catword .. ' κατά επίθημα (' .. lang_name .. ')|' .. sort .. ']]' ..  "\n"
				end
			end


			end -- close compound category
-- need multicat here
		
		end -- close cat_parenthesis
	end -- close names+επίθημα suffix


-- ============== phrasal verbs  με το ...  ================
	if mw.ustring.find(cat_title, "Phrasal verbs με το") then

-- a mode, no (language) -- there are no such categories at the moment
		if cat_parenthesis == '' or cat_parenthesis == nil then
			text = text_wikt .. ' » [[:Κατηγορία:Γραμματικές κατηγορίες|Γραμματικές κατηγορίες]]'
			.. ' » [[:Κατηγορία:Ρήματα|Ρήματα]]'
			.. ' » [[:Κατηγορία:Phrasal verbs|Phrasal verbs]]'
			if show_other == '' or show_other == nil then
				text = text
				.. ' » με το <b>[[' .. mw.ustring.sub(mw.ustring.match(cat_title, "Phrasal verbs με το (.*)"), 1, -1) .. ']]</b>'
			else
				text = text .. ' » <b>' .. show_other .. '</b>'
			end
			
			-- cat a
			cat = '[[Κατηγορία:Phrasal verbs|' .. mw.ustring.sub(mw.ustring.match(cat_title, "Phrasal verbs με το (.*)"), 1, -1) .. ']]' ..  "\n"

		else -- with language
-- b mode e.g. [[:Κατηγορία:Phrasal verbs με το out (αγγλικά)]]
	-- no known sublangs for phrasal verbs
			text = text_lang .. ' » [[:Κατηγορία:Γραμματικές κατηγορίες (' .. lang_name .. ')|Γραμματικές κατηγορίες]]'
			.. ' » [[:Κατηγορία:Ρήματα (' .. lang_name .. ')|Ρήματα]]'
			.. ' » [[:Κατηγορία:Phrasal verbs (' .. lang_name .. ')|Phrasal verbs]]'
			if show_other == '' or show_other == nil then
				text = text
				.. ' » με το [[' .. mw.ustring.sub(mw.ustring.match(cat_title, "Phrasal verbs με το (.*)"), 1, -1) 
				.. "#" .. languages[lang_iso].link 
				.. "|<b>" .. mw.ustring.sub(mw.ustring.match(cat_title, "Phrasal verbs με το (.*)"), 1, -1) .. '</b>]]'
			else
				text = text .. ' » <b>' .. show_other .. '</b>'
			end
			
			-- cat b
			cat = '[[Κατηγορία:Phrasal verbs (' .. lang_name .. ')|' .. mw.ustring.sub(mw.ustring.match(cat_title, "Phrasal verbs με το (.*)"), 1, -1) .. ']]' ..  "\n"
		
		end -- close cat_parenthesis
	end -- close phrasal verbs



--------------------------------------------------------------------------
--                     Ετυμολογία Etymology                             --
--                FUNCTIONS apota : from xx language)                   --
--------------------------------------------------------------------------
-- e.g. [[:Κατηγορία:Δανεισμοί από τα αγγλικά]]- [[:Κατηγορία:Δανεισμοί από τα αγγλικά (νέα ελληνικά)]]
-- ============ apota: match the last part of the cat_title with Module:languages param. apota (από ...)
--[=[
1) extract apota from cat_title e.g. από τα αγγλικά
2) match it with [[Module:Languages]].apota -- I do not know how to match it.
	instead, i write manually the first part of the title, and substract it. What is left is 'supposed' to match to [[Module:Languages]].apota
3) get its lang_iso2 from [[Module:lang]] with function p.langapota_to_langiso(apota)
4) cat_title minus apota = apota_label
The possible pattern of apota is: από+space+...word or words at the END of the category name.
The word 'από' appears also in keyword 'from' where the word 'προέλευση' is always found.
5) unidentified languages (iso = - name = διάφορες γλώσσες) 
	Do not write the laste part << Ετυμολογία  << Διάφορες γλώσσες 
	[[:Κατηγορία:Μεταγραμμένοι όροι - ονόματα από διάφορες γλώσσες (νέα ελληνικά)]]
* sublangs are subordinate languages (like dialects or phases) 
	They appear in the Cateogory of host lang
	The host lang Category appears at breadcrumb
	USE if languages[lang_iso].host_iso == languages[lang_iso2].iso then
		to avoid Κατηγορία:..... από τα χ (χ)
-- TEST PAGES
	-- [[:Κατηγορία:Δάνεια από τα γαλλικά]]
	-- [[:Κατηγορία:Δάνεια από τα γαλλικά (νέα ελληνικά)]]
# Expressions with από to avoid
* από το [[:Κατηγορία:Λέξεις με πρόθημα δι- από το δις (νέα ελληνικά)]]
* all expressions from [[Template:από]]
* λέξεις που έχουν α-π-ο όπως «απόλυτα»
-- PROBLEMATIC: [[:Κατηγορία:Προέλευση λέξεων από τουρκικές γλώσσες (νέα ελληνικά)]] MUST NOT and not mw.ustring.find(cat_title, 'από το')

]=]--

-- ++ -- NOT Λέξεις από: βλ. [[Πρότυπο:από]]  
-- # PROBLEMATIC: [[:Κατηγορία:Προέλευση λέξεων από τουρκικές γλώσσες (νέα ελληνικά)]] MUST NOT and not mw.ustring.find(cat_title, 'από το')
function get_apota_text(apota_text)
	if mw.ustring.find(cat_title, 'από') and not mw.ustring.find(cat_title, 'από το ') and not mw.ustring.find(cat_title, 'αναδρομικό')
	and not mw.ustring.find(cat_title, 'ρίζα') and not mw.ustring.find(cat_title, 'ρίζες')
--	other από
	and not mw.ustring.find(cat_title, 'από ανθρωπωνύμια')
	and not mw.ustring.find(cat_title, 'από αξιώματα') 
	and not mw.ustring.find(cat_title, 'από δημοτικά τραγούδια') 
	and not mw.ustring.find(cat_title, 'από διαφημίσεις') 
	and not mw.ustring.find(cat_title, 'από εθνικά ονόματα') 
	and not mw.ustring.find(cat_title, 'από επαγγέλματα') 
	and not mw.ustring.find(cat_title, 'από επιγραφές') 
	and not mw.ustring.find(cat_title, 'από επωνυμίες') 
	and not mw.ustring.find(cat_title, 'από ιατρικά')
	and not mw.ustring.find(cat_title, 'από ιδιότητες') 
	and not mw.ustring.find(cat_title, 'από καλλιτεχνικά έργα') 
	and not mw.ustring.find(cat_title, 'από λεξικά') 
	and not mw.ustring.find(cat_title, 'από νόμους')
	and not mw.ustring.find(cat_title, 'από ονόματα')
	and not mw.ustring.find(cat_title, 'από παπύρους') 
	and not mw.ustring.find(cat_title, 'από παρωνύμια') 
	and not mw.ustring.find(cat_title, 'από συναρπαγή')
	and not mw.ustring.find(cat_title, 'από τα έργα')
	and not mw.ustring.find(cat_title, 'από τις τέχνες') 
	and not mw.ustring.find(cat_title, 'από τον') 
	and not mw.ustring.find(cat_title, 'από τοπωνύμια')
-- words
	and not mw.ustring.find(cat_title, 'απόλυτα')
	and not mw.ustring.find(cat_title, 'απόστολος')
	and not mw.ustring.find(cat_title, 'Λέξεις από') 
	and not mw.ustring.find(cat_title, 'πρόθημα από')
	and not mw.ustring.find(cat_title, 'ως προς')  
	then 
--	apota_text = "από " .. mw.ustring.sub(mw.ustring.match(cat_title, "[α][π][ό]%s(.+)"), 1, -1)	-- gives από + τα αγγλικά
	apota_text = "από " .. mw.ustring.sub(mw.ustring.match(cat_title, "από (.*)"), 1, -1)			-- capture as by Benwing2
	end
return apota_text
end

-- I CANNOT match apota_text with [[Module:Languages]].apota.

function get_apota(iso2)
	lang_iso2 = require("Module:lang").langapota_to_langiso(get_apota_text(apota_text))
return lang_iso2
end

function get_apota_label(apota_label)
	length = mw.ustring.len(get_apota_text(apota_text))
	apota_label = mw.ustring.sub(cat_title, 1, -length-1) -- length gives me: Label α.  So, i substract one more.
return apota_label
end

	local nohost = args['nohost'] or '' -- only for [[Module:Languages]].sublang DO NOT give the host language data.
	
-- -------------------- APPLICATIONS apota -------------------------
-- # PROBLEMATIC: [[:Κατηγορία:Προέλευση λέξεων από τουρκικές γλώσσες (νέα ελληνικά)]] MUST NOT and not mw.ustring.find(cat_title, 'από το')
-- ety 3 a + apota etymology
	if mw.ustring.find(cat_title, 'από') and not mw.ustring.find(cat_title, 'από το ') and not mw.ustring.find(cat_title, 'αναδρομικό')
	and not mw.ustring.find(cat_title, 'ρίζα') and not mw.ustring.find(cat_title, 'ρίζες')
--	other από
	and not mw.ustring.find(cat_title, 'από ανθρωπωνύμια')
	and not mw.ustring.find(cat_title, 'από αξιώματα') 
	and not mw.ustring.find(cat_title, 'από δημοτικά τραγούδια') 
	and not mw.ustring.find(cat_title, 'από διαφημίσεις') 
	and not mw.ustring.find(cat_title, 'από εθνικά ονόματα') 
	and not mw.ustring.find(cat_title, 'από επαγγέλματα') 
	and not mw.ustring.find(cat_title, 'από επιγραφές') 
	and not mw.ustring.find(cat_title, 'από επωνυμίες') 
	and not mw.ustring.find(cat_title, 'από ιατρικά')
	and not mw.ustring.find(cat_title, 'από ιδιότητες') 
	and not mw.ustring.find(cat_title, 'από καλλιτεχνικά έργα') 
	and not mw.ustring.find(cat_title, 'από λεξικά') 
	and not mw.ustring.find(cat_title, 'από νόμους')
	and not mw.ustring.find(cat_title, 'από ονόματα')
	and not mw.ustring.find(cat_title, 'από παπύρους') 
	and not mw.ustring.find(cat_title, 'από παρωνύμια') 
	and not mw.ustring.find(cat_title, 'από συναρπαγή')
	and not mw.ustring.find(cat_title, 'από τα έργα')
	and not mw.ustring.find(cat_title, 'από τις τέχνες') 
	and not mw.ustring.find(cat_title, 'από τον') 
	and not mw.ustring.find(cat_title, 'από τοπωνύμια')
-- words
	and not mw.ustring.find(cat_title, 'απόλυτα')
	and not mw.ustring.find(cat_title, 'απόστολος')
	and not mw.ustring.find(cat_title, 'Λέξεις από') 
	and not mw.ustring.find(cat_title, 'πρόθημα από')
	and not mw.ustring.find(cat_title, 'ως προς')  
	then 
		lang_iso2 = get_apota(apota_text)
		apota_text = get_apota_text(cat_title)
		apota_label = get_apota_label(cat_title)
	-- text b + hosted languages IF THERE IS MORE ?????????? checkthis
	--##$PROBLEM?? 
--	if languages[lang_iso2].sublang == true then -- [[:Κατηγορία:Προέλευση λέξεων από την ελληνιστική κοινή]]
--		text = '[[:Κατηγορία:' .. languages[lang_iso2].host .. '|<b>' .. languages[lang_iso2].host_show .. '</b>]]'
--		.. lang_cat .. '|' .. lang_cat .. ']]'
--	end	



-- APOTA+TITLES Προέλευση/Δανεισμοί/Κληρονομημένες λέξεις/Παραγωγή etc 
-- απευθείας στο directly to parent = Ετυμολογία
	-- test[[:Κατηγορία:Προέλευση λέξεων από τα αγγλικά]] -- [[:Κατηγορία:Προέλευση λέξεων από τα αγγλικά (νέα ελληνικά)]]
	-- [[:Κατηγορία:Προέλευση λέξεων από τα αρχαία ελληνικά]] [[:Κατηγορία:Κληρονομημένες λέξεις από τα αρχαία ελληνικά (νέα ελληνικά)]]
	if mw.ustring.find(cat_title, 'από') and 
	(mw.ustring.find(cat_title, 'Προέλευση λέξεων') or mw.ustring.find(cat_title, 'Κληρονομημένες λέξεις') 
	or mw.ustring.find(cat_title, 'Παραγωγή λέξεων') or mw.ustring.find(cat_title, 'Δανεισμοί'))
	and not mw.ustring.find(cat_title, 'ρίζα') and not mw.ustring.find(cat_title, 'ρίζες')
	then
		lang_iso2 = get_apota(apota_text)
		apota_text = get_apota_text(cat_title)
		apota_label = get_apota_label(cat_title)
		if mw.ustring.find(cat_title, 'Προέλευση λέξεων') then write_cat = 'Προέλευση λέξεων' end
		if mw.ustring.find(cat_title, 'Παραγωγή λέξεων') then write_cat = 'Παραγωγή λέξεων' end
		if mw.ustring.find(cat_title, 'Κληρονομημένες λέξεις') then write_cat = 'Κληρονομημένες λέξεις' end
		if mw.ustring.find(cat_title, 'Δανεισμοί') then write_cat = 'Δανεισμοί' end

-- a mode apota+titles
		if cat_parenthesis == '' or cat_parenthesis == nil then
			text = text_wikt .. ' » [[:Κατηγορία:Ετυμολογία|Ετυμολογία]]'
			.. ' » [[:Κατηγορία:' .. write_cat .. '|' .. write_cat .. ']]'
			.. ' » [[:Κατηγορία:' .. cat_title .. '|'  .. languages[lang_iso2].apota .. ']]'
			if languages[lang_iso2].iso == '-' then  -- διάφορες γλώσσες
			text = text
			else
			text = text 
			.. ' « [[:Κατηγορία:Ετυμολογία (' .. languages[lang_iso2].name ..  ')|<i>Ετυμολογία</i>]]'
			.. ' « [[:Κατηγορία:' .. languages[lang_iso2].cat ..  '|<i>' .. mw.getContentLanguage():ucfirst(languages[lang_iso2].name) .. '</i>]]'
			end
			 -- [[:Κατηγορία:Προέλευση λέξεων από την ελληνιστική κοινή]]
			if languages[lang_iso2].sublang == true then
			text = text 
			.. ' « [[:Κατηγορία:' .. languages[lang_iso2].host ..  '|<i>' .. mw.getContentLanguage():ucfirst(languages[lang_iso2].host_name) .. '</i>]]'
			end
-- sublangsISO2:host row, e.g. [[:Κατηγορία:Προέλευση λέξεων από την ελληνιστική κοινή]] + από τα αρχαία ελληνικά
	if languages[lang_iso2].sublang == true then
		if nohost == '1' then
		text = text
		else
		text = text 
		.. ' <dl><dd>« [[:Κατηγορία:' .. write_cat .. ' ' .. languages[lang_iso2].host_apota  .. ']]</dd></dl>'
		end
	end -- close if sublang
			--descr	
			if write_cat == 'Προέλευση λέξεων' then
				text_plus = descr_der 
--				.. "<br>" 
--				.. '&nbsp;  &nbsp;  Ειδικότερα, περιλαμβάνει ' .. '[[:Κατηγορία:Κληρονομημένες λέξεις ' .. apota_text .. '|κληρονομημένες λέξεις]]'
--				.. ' και ' .. '[[:Κατηγορία:Δανεισμοί ' .. apota_text .. '|δανεισμούς]].'
			end
			if write_cat == 'Παραγωγή λέξεων' then -- repeat descr as in [[Module:auto cat/data]]
				text = text .. "<br>" 
				.. '&nbsp;  &nbsp;  Δημιουργία νέας λέξης με βάση μια άλλη που προέρχεται από διαφορετική περίοδο ή από διαφορετική γλώσσα.'
			end
				
			-- cat a  -- [[:Κατηγορία:Προέλευση λέξεων από την ελληνιστική κοινή]]
			-- NOT having nohost=1 it is useless here.
			if languages[lang_iso2].sublang == true then
--				if nohost == '1' then
--				cat = '[[Κατηγορία:' .. write_cat .. ' (' .. languages[lang_iso2].name .. ')|' .. "'" .. languages[lang_iso2].key .. ']]' .. "\n"
--				else -- apota_key only for sublangs is = with "'"
				cat = '[[Κατηγορία:' .. write_cat .. ' (' .. languages[lang_iso2].name .. ')|' .. "'" .. languages[lang_iso2].key .. ']]' .. "\n"
				.. '[[Κατηγορία:' .. write_cat .. ' ' .. languages[lang_iso2].host_apota .. '|' .. languages[lang_iso2].apota_key .. ']]' .. "\n"
--				end -- close nohost
			else
				-- key = itself with "'"
				cat = '[[Κατηγορία:' .. write_cat ..' (' .. languages[lang_iso2].name  .. ')|' .. "'" .. languages[lang_iso2].key .. ']]' .. "\n"
			end
			
-- b mode apota  -- [[:Κατηγορία:Προέλευση λέξεων από τα αρχαία ελληνικά (νέα ελληνικά)]]
		else

			text = text_lang ..  ' » [[:Κατηγορία:Ετυμολογία (' ..	lang_name .. ')|Ετυμολογία]]' 
			.. ' » [[:Κατηγορία:' .. write_cat .. ' (' .. lang_name .. ')|' .. write_cat .. ']]'
			.. ' » [[:Κατηγορία:' .. page_text .. '|' .. languages[lang_iso2].apota .. ']]'
			.. ' [[:Κατηγορία:' .. cat_title .. '|«««]]'
			-- NOT [[:Κατηγορία:Προέλευση λέξεων από τα νέα ελληνικά (νέα ελληνικά)]] but it IS possible semantic loans (add it manually)
			if languages[lang_iso2].iso == '-'  -- διάφορες γλώσσες
			or languages[lang_iso2].iso == languages[lang_iso].host_iso -- Κατηγορία:Προέλευση λέξεων από τα λατινικά (νεολατινικά)
			or languages[lang_iso2].iso == languages[lang_iso].iso -- Κατηγορία:Προέλευση λέξεων από τα νέα ελληνικά (νέα ελληνικά) possible, rare
			then
			text = text
			else
			text = text 
			.. ' « [[:Κατηγορία:Ετυμολογία (' .. languages[lang_iso2].name ..  ')|<i>Ετυμολογία</i>]]'
			.. ' « [[:Κατηγορία:' .. languages[lang_iso2].cat ..  '|<i>' .. mw.getContentLanguage():ucfirst(languages[lang_iso2].name) .. '</i>]]'
			end
				-- Κατηγορία:Προέλευση λέξεων από την καθαρεύουσα (νέα ελληνικά)
				if languages[lang_iso2].sublang == true
				and languages[lang_iso2].host_iso ~= languages[lang_iso].iso -- Κατηγορία:Προέλευση λέξεων από τα μεσαιωνικά λατινικά (λατινικά)
				and languages[lang_iso2].host_iso ~= languages[lang_iso].host_iso -- hypothetical Κατηγορία:Προέλευση λέξεων από τα μεσαιωνικά λατινικά (νεολατινικά)
				then
				text = text 
				.. ' « [[:Κατηγορία:' .. languages[lang_iso2].host ..  '|<i>' .. mw.getContentLanguage():ucfirst(languages[lang_iso2].host_name) .. '</i>]]'
				end
-- sublangs:host row, e.g. [[:Κατηγορία:Προέλευση λέξεων από την ελληνιστική κοινή (κυπριακά)]]
	-- but not ITS host Κατηγορία:Προέλευση λέξεων από τα αρχαία ελληνικά (ελληνιστική κοινή)
	-- giving Κατηγορία:Προέλευση λέξεων από τα αρχαία ελληνικά (αρχαία ελληνικά)
		if languages[lang_iso].sublang == true then
			if nohost == '1' 
			or languages[lang_iso2].host_iso == languages[lang_iso].iso 
			or languages[lang_iso2].iso == languages[lang_iso].host_iso 
			then
			text = text
			else
			text = text .. ' <dl><dd>« [[:Κατηγορία:' .. write_cat .. ' ' .. apota_text  .. ' (' .. languages[lang_iso].host_name  .. ')]]</dd></dl>'
			end
		end -- close if sublang
-- plus
			if write_cat == 'Προέλευση λέξεων' then
				text_plus =  descr_der .. "<br>" 
				-- e.g. [[:Κατηγορία:Προέλευση λέξεων από τα οθωμανικά τουρκικά (νέα ελληνικά)]]
--				.. '&nbsp;  &nbsp;  Ειδικότερα, περιλαμβάνει ' .. '[[:Κατηγορία:Κληρονομημένες λέξεις ' .. apota_text .. ' (' .. lang_name .. ')|κληρονομημένες λέξεις]]'
--				.. ' και ' .. '[[:Κατηγορία:Δανεισμοί ' .. apota_text .. ' (' .. lang_name .. ')|δανεισμούς]].'
			end
			if write_cat == 'Παραγωγή λέξεων' then -- repeat descr as in [[Module:auto cat/data]]
				text = text .. "<br>" 
				.. '&nbsp;  &nbsp;  Δημιουργία νέας λέξης με βάση μια άλλη που προέρχεται από διαφορετική περίοδο ή από διαφορετική γλώσσα.'
			end


			-- cat b
			-- [[:Κατηγορία:Προέλευση λέξεων (ελληνιστική κοινή)]] is  OK at level_2
			-- [[:Κατηγορία:Προέλευση λέξεων από την ελληνιστική κοινή]] - ΟΚ at mode a

			-- lang (sublang other) [[:Κατηγορία:Προέλευση λέξεων από τα λατινικά (ελληνιστική κοινή)]]
			-- lang (sublang same) [[:Κατηγορία:Προέλευση λέξεων από τα αρχαία ελληνικά (ελληνιστική κοινή)]]
			if languages[lang_iso].sublang == true and not languages[lang_iso2].sublang == true then
				if nohost == '1' or languages[lang_iso].host_iso == languages[lang_iso2].iso then
				cat = '[[Κατηγορία:' .. write_cat .. ' ' .. apota_text  .. '|' .. languages[lang_iso].host_key.. ']]' .. "\n"
				.. '[[Κατηγορία:' .. write_cat .. ' (' .. languages[lang_iso].name  .. ')|' .. languages[lang_iso2].key .. ']]' .. "\n"
				else
				cat = '[[Κατηγορία:' .. write_cat .. ' ' .. apota_text  .. '|' .. languages[lang_iso].key.. ']]' .. "\n"
				.. '[[Κατηγορία:' .. write_cat .. ' ' .. apota_text  .. ' (' .. languages[lang_iso].host_name  .. ')|' .. languages[lang_iso].host_key.. ']]' .. "\n"
				.. '[[Κατηγορία:' .. write_cat .. ' (' .. languages[lang_iso].name  .. ')|' .. languages[lang_iso2].key .. ']]' .. "\n"
-- too much  .. '[[Κατηγορία:' .. write_cat .. ' (' .. languages[lang_iso2].name  .. ')|' .. languages[lang_iso]['key'] .. ']]' .. "\n"
				end
			-- sublang (lang other) [[:Κατηγορία:Προέλευση λέξεων από την ελληνιστική κοινή (νέα ελληνικά)]]
			-- sublang (lang same)  [[:Κατηγορία:Προέλευση λέξεων από την καθαρεύουσα (νέα ελληνικά)]]
			elseif languages[lang_iso2].sublang == true and not languages[lang_iso].sublang == true then
				if nohost == '1' or languages[lang_iso2].host_iso == languages[lang_iso].iso then
				cat = '[[Κατηγορία:' .. write_cat .. ' ' .. apota_text  .. '|' .. languages[lang_iso].key.. ']]' .. "\n"
				.. '[[Κατηγορία:' .. write_cat .. ' (' .. languages[lang_iso].name  .. ')|' .. languages[lang_iso2].key .. ']]' .. "\n"	
--too much--	.. '[[Κατηγορία:' .. write_cat .. ' (' .. languages[lang_iso2].name  .. ')|' .. languages[lang_iso].key .. ']]' .. "\n"	
				else
				cat = '[[Κατηγορία:' .. write_cat .. ' ' .. apota_text  .. '|' .. languages[lang_iso].key.. ']]' .. "\n"
				.. '[[Κατηγορία:' .. write_cat .. ' ' .. languages[lang_iso2].host_apota .. ' (' .. languages[lang_iso].name .. ')|' .. languages[lang_iso2].apota_key .. ']]' .. "\n"
				.. '[[Κατηγορία:' .. write_cat .. ' (' .. languages[lang_iso].name  .. ')|' .. languages[lang_iso2]['key'] .. ']]' .. "\n"
				end
			-- sublang (sublang other) [[:Κατηγορία:Προέλευση λέξεων από την ελληνιστική κοινή (νεολατινικά)]]
			-- sublang (sublang same) [[:Κατηγορία:Προέλευση λέξεων από τα μεσαιωνικά λατινικά (νεολατινικά)]]
			elseif languages[lang_iso].sublang == true and languages[lang_iso2].sublang == true then
				if nohost == '1' or languages[lang_iso].host_iso == languages[lang_iso2].host_iso then
				cat = '[[Κατηγορία:' .. write_cat .. ' ' .. apota_text  .. '|' .. languages[lang_iso].host_key.. ']]' .. "\n"
				.. '[[Κατηγορία:' .. write_cat .. ' (' .. languages[lang_iso].name  .. ')|' .. languages[lang_iso2].host_key .. ']]' .. "\n"
				else
				cat = '[[Κατηγορία:' .. write_cat .. ' ' .. apota_text  .. '|' .. languages[lang_iso]['key'].. ']]' .. "\n"
				.. '[[Κατηγορία:' .. write_cat .. ' ' .. apota_text  .. ' (' .. languages[lang_iso].host_name  .. ')|' .. languages[lang_iso].host_key.. ']]' .. "\n"
				.. '[[Κατηγορία:' .. write_cat .. ' ' .. languages[lang_iso2].host_apota .. ' (' .. languages[lang_iso].name .. ')|' .. languages[lang_iso2].apota_key .. ']]' .. "\n"
				.. '[[Κατηγορία:' .. write_cat .. ' (' .. languages[lang_iso].name  .. ')|' .. languages[lang_iso2].key .. ']]' .. "\n"
				end
			-- lang (lang other) [[:Κατηγορία:Προέλευση λέξεων από τα αγγλικά (νέα ελληνικά)]]
			-- lang (lang same) [[:Κατηγορία:Προέλευση λέξεων από τα νέα ελληνικά (νέα ελληνικά)]]
			else
				-- possible, rare for some semantic loans, same language [[:Κατηγορία:Προέλευση λέξεων από τα νέα ελληνικά (νέα ελληνικά)]]
				-- $? allow it to be cancelled with nohost=1?
				cat = '[[Κατηγορία:' .. write_cat .. ' ' .. apota_text  .. '|' .. languages[lang_iso]['key'].. ']]' .. "\n"
				.. '[[Κατηγορία:' .. write_cat .. ' (' .. languages[lang_iso].name  .. ')|' .. languages[lang_iso2].key .. ']]' .. "\n"
			end
		end -- close parenthesis
	end -- close APOTA+TITLES under 'Ετυμολογία'



-- APOTA-BORROWING.KINDS under Borrowings ΔΑΝΕΙΣΜΟΙ + διάφορα είδη δανεισμών ============ με parent = Δανεισμοί
-- apota for data.ety_loans	CANNOT match apota_label TO data.ety_loans I will do them one by one.
	if mw.ustring.find(cat_title, 'από') and not mw.ustring.find(cat_title, 'προέλευση') and not mw.ustring.find(cat_title, 'από τα έργα')
	and not mw.ustring.find(cat_title, 'παραγωγή') and not mw.ustring.find(cat_title, 'δανεισμοί')
	and not mw.ustring.find(cat_title, 'απόλυτα')
	and 
	(mw.ustring.find(cat_title, 'Αντιδάνεια')
	or mw.ustring.find(cat_title, 'Λόγια δάνεια') 
	or mw.ustring.find(cat_title, 'Μεταφραστικά δάνεια')
	or mw.ustring.find(cat_title, 'Σημασιολογικά δάνεια')
	or mw.ustring.find(cat_title, 'Ορθογραφικά δάνεια')
	or mw.ustring.find(cat_title, 'Μεταφραστικές αποδόσεις')
	or mw.ustring.find(cat_title, 'Φωνητικές αποδόσεις')
	or mw.ustring.find(cat_title, 'Μεταγραμμένοι όροι')
	or (mw.ustring.find(cat_title, 'Δάνεια')
	and not mw.ustring.find(cat_title, '-'))) 
	then
		lang_iso2 = get_apota(apota_text)
		apota_text = get_apota_text(cat_title)
		apota_label = get_apota_label(cat_title)
		
--		write_text = '' == $?what is this
		-- [[:Κατηγορία:Δάνεια από τα αγγλικά]] -- [[:Κατηγορία:Δάνεια από τα αγγλικά (νέα ελληνικά)]]
		if mw.ustring.find(cat_title, 'Δάνεια') then
			write_cat = 'Δάνεια'
			text_plus = '<dl><dd>[[δάνειο|Άμεσα γλωσσικά δάνεια]] από μία γλώσσα σε άλλη με την επαφή των ομιλητών. Δείτε και τα λόγια δάνεια.</dd></dl>'
		end
		-- [[:Κατηγορία:Λόγια δάνεια από τα αγγλικά]] -- [[:Κατηγορία:Λόγια δάνεια από τα αγγλικά (νέα ελληνικά)]]
		if mw.ustring.find(cat_title, 'Λόγια δάνεια') then
			write_cat = 'Λόγια δάνεια'
			text_plus = '<dl><dd>[[λόγιο δάνειο|Λόγια γλωσσικά δάνεια]] δημιουργημένα από λογίους, συγγραφείς, επιστήμονες. Δείτε και τα άμεσα λαϊκά δάνεια.</dd></dl>'
		end
		if mw.ustring.find(cat_title, 'Αντιδάνεια') then write_cat = 'Αντιδάνεια' end
		if mw.ustring.find(cat_title, 'Μεταφραστικά δάνεια') then write_cat = 'Μεταφραστικά δάνεια' end
		if mw.ustring.find(cat_title, 'Ορθογραφικά δάνεια') then write_cat = 'Ορθογραφικά δάνεια' end
		if mw.ustring.find(cat_title, 'Σημασιολογικά δάνεια') then write_cat = 'Σημασιολογικά δάνεια' end
		if mw.ustring.find(cat_title, 'Μεταφραστικές αποδόσεις') then write_cat = 'Μεταφραστικές αποδόσεις' end
		if mw.ustring.find(cat_title, 'Φωνητικές αποδόσεις') then write_cat = 'Φωνητικές αποδόσεις' end
		if mw.ustring.find(cat_title, 'Μεταγραμμένοι όροι') then write_cat = 'Μεταγραμμένοι όροι' end


-- a mode apota+bor.kinds
		if cat_parenthesis == '' or cat_parenthesis == nil then
			text = text_wikt .. ' » [[:Κατηγορία:Ετυμολογία|Ετυμολογία]]'
			.. ' » [[:Κατηγορία:Δανεισμοί|Δανεισμοί]] » [[:Κατηγορία:' .. write_cat .. '|' .. mw.getContentLanguage():lcfirst(write_cat) .. ']]'
			.. ' » [[:Κατηγορία:' .. cat_title .. '|'  .. languages[lang_iso2].apota .. ']]'
			-- Κατηγορία:Δάνεια από τα αγγλικά
			if languages[lang_iso2].iso == '-' then  -- διάφορες γλώσσες
			text = text
			else
			text = text 
			.. ' « [[:Κατηγορία:Ετυμολογία (' .. languages[lang_iso2].name .. ')|<i>Ετυμολογία</i>]]'
			.. ' « [[:Κατηγορία:' .. languages[lang_iso2].cat .. '|<i>' .. mw.getContentLanguage():ucfirst(languages[lang_iso2].name) .. '</i>]]'
			end
			-- Κατηγορία:Λόγια δάνεια από την ελληνιστική κοινή
			if languages[lang_iso2].sublang == true then
			text = text 
			.. ' « [[:Κατηγορία:' .. languages[lang_iso2].host .. '|<i>' .. mw.getContentLanguage():ucfirst(languages[lang_iso2].host_name) .. '</i>]]'
			end
-- sublangsISO2:host row, e.g. [[:Κατηγορία:Δανεισμοί από την ελληνιστική κοινή]] + από τα αρχαία ελληνικά
	if languages[lang_iso2].sublang == true then
		if nohost == '1' then
		text = text
		else
		text = text 
		.. ' <dl><dd>« [[:Κατηγορία:' .. write_cat .. ' ' .. languages[lang_iso2].host_apota  .. ']]</dd></dl>'
		end
	end -- close if sublang
-- too much
--			if mw.ustring.find(cat_title, 'Μεταφραστικά δάνεια') and cat_lang ~= 'ελληνιστική κοινή' then -- [[:Κατηγορία:Μεταφραστικά δάνεια από τα γαλλικά]]
--				text = text  .. "\n"
--				..	frame:expandTemplate{ title = 'δείτε', args = {':Κατηγορία:Μεταφραστικές αποδόσεις ' .. apota_text } } .. "\n"
--			end
--			if mw.ustring.find(cat_title, 'Μεταφραστικές αποδόσεις') and cat_lang ~= 'ελληνιστική κοινή' then -- [[:Κατηγορία:Μεταφραστικές αποδόσεις από τα γαλλικά]]
--				text = text  .. "\n"
--				..	frame:expandTemplate{ title = 'δείτε', args = {':Κατηγορία:Μεταφραστικά δάνεια ' .. apota_text} } .. "\n"
--			end		
				
			-- cat a  [[:Κατηγορία:Λόγια δάνεια από την ελληνιστική κοινή]]
			if languages[lang_iso2].sublang then
			-- no need for nohost=1
				-- Κατηγορία:Μεταφραστικά δάνεια από τα δημώδη λατινικά
				cat = '[[Κατηγορία:' .. write_cat .. ' (' .. languages[lang_iso2].name .. ')|' .. "'" .. languages[lang_iso2].key .. ']]' .. "\n"
				.. '[[Κατηγορία:' .. write_cat .. ' ' .. languages[lang_iso2].host_apota .. '|' .. languages[lang_iso2].apota_key .. ']]' .. "\n"
				.. '[[Κατηγορία:Δανεισμοί ' .. apota_text .. '| ' .. languages[lang_iso2].apota_key .. ']]' .. "\n" -- sort top
			else
				cat = '[[Κατηγορία:' .. write_cat .. ' (' .. languages[lang_iso2].name  .. ')|' .. "'" .. languages[lang_iso2].key .. ']]' .. "\n"
				.. '[[Κατηγορία:Δανεισμοί ' .. apota_text  .. '| ' .. cat_title ..  ']]' .. "\n" -- sort top
			end


-- b mode apota+bor.kinds
		else

			text = text_lang ..  ' » [[:Κατηγορία:Ετυμολογία (' ..	lang_name .. ')|Ετυμολογία]]'
			.. ' » [[:Κατηγορία:Δανεισμοί (' ..	lang_name .. ')|Δανεισμοί]]'
			.. ' » [[:Κατηγορία:' .. write_cat .. ' (' ..	lang_name .. ')|' .. mw.getContentLanguage():lcfirst(write_cat) .. ']]'
			.. ' » [[:Κατηγορία:' .. page_text .. '|' .. languages[lang_iso2].apota .. ']]'
			.. ' [[:Κατηγορία:' .. cat_title .. '|«««]]'
			if languages[lang_iso2].iso == '-'  -- διάφορες γλώσσες  -- Κατηγορία:Μεταγραμμένοι όροι από διάφορες γλώσσες (νέα ελληνικά)
			or languages[lang_iso2].iso == languages[lang_iso].host_iso
			or languages[lang_iso2].iso == languages[lang_iso].iso --- Κατηγορία:Σημασιολογικά δάνεια από τα νέα ελληνικά (νέα ελληνικά) possible, rare
			then
			text = text
			else
			text = text 
			.. ' « [[:Κατηγορία:Ετυμολογία (' .. languages[lang_iso2].name ..  ')|<i>Ετυμολογία</i>]]'
			.. ' « [[:Κατηγορία:' .. languages[lang_iso2].cat ..  '|<i>' .. mw.getContentLanguage():ucfirst(languages[lang_iso2].name) .. '</i>]]'
			end
					 -- Κατηγορία:Λόγια δάνεια από τα αρχαία ελληνικά (καθαρεύουσα)
					if languages[lang_iso2].sublang == true
					and languages[lang_iso2].host_iso ~= languages[lang_iso].iso
					and languages[lang_iso2].host_iso ~= languages[lang_iso].host_iso
					then
					text = text 
					.. ' « [[:Κατηγορία:' .. languages[lang_iso2].host ..  '|<i>' .. mw.getContentLanguage():ucfirst(languages[lang_iso2].host_name) .. '</i>]]'
					end
-- sublangs:host row, e.g. [[:Κατηγορία:Λόγια δάνεια από την ελληνιστική κοινή (καθαρεύουσα)]]
		if languages[lang_iso].sublang == true then
			if nohost == '1' 
			or languages[lang_iso2].host_iso == languages[lang_iso].iso 
			or languages[lang_iso2].iso == languages[lang_iso].host_iso 
			then
			text = text
			else
			text = text .. ' <dl><dd>« [[:Κατηγορία:' .. write_cat .. ' ' .. apota_text  .. ' (' .. languages[lang_iso].host_name  .. ')]]</dd></dl>'
			end
		end -- close if sublang
-- too much
--			if mw.ustring.find(cat_title, 'Μεταφραστικά δάνεια') and cat_lang ~= 'ελληνιστική κοινή' then -- [[:Κατηγορία:Μεταφραστικά δάνεια από τα γαλλικά (νέα ελληνικά)]]
--				text = text  .. "\n"
--				..	frame:expandTemplate{ title = 'δείτε', args = {':Κατηγορία:Μεταφραστικές αποδόσεις ' .. apota_text .. ' (' .. lang_name .. ')' } } .. "\n"
--			end
--			if mw.ustring.find(cat_title, 'Μεταφραστικές αποδόσεις') and cat_lang ~= 'ελληνιστική κοινή' then -- [[:Κατηγορία:Μεταφραστικές αποδόσεις από τα γαλλικά (νέα ελληνικά)]]
--				text = text  .. "\n"
--				..	frame:expandTemplate{ title = 'δείτε', args = {':Κατηγορία:Μεταφραστικά δάνεια ' .. apota_text .. ' (' .. lang_name .. ')' } } .. "\n"
--			end


			-- cat b
			-- lang (sublang other) -- Κατηγορία:Δάνεια από τα αρχαία ελληνικά (νεολατινικά)
			-- lang (sublang same)
			if languages[lang_iso].sublang == true and not languages[lang_iso2].sublang == true then
				if nohost == '1' or languages[lang_iso].host_iso == languages[lang_iso2].iso then
				cat = '[[Κατηγορία:' .. write_cat .. ' ' .. apota_text  .. '|' .. languages[lang_iso]['key'].. ']]' .. "\n"
				.. '[[Κατηγορία:' .. write_cat .. ' (' .. languages[lang_iso].name  .. ')|' .. languages[lang_iso2]['key'] .. ']]' .. "\n"
				.. '[[Κατηγορία:Δανεισμοί ' .. apota_text .. ' (' .. languages[lang_iso].name .. ')| ' .. write_cat .. ']]' .. "\n" -- sort top
				else
				cat = '[[Κατηγορία:' .. write_cat .. ' ' .. apota_text  .. '|' .. languages[lang_iso]['key'].. ']]' .. "\n"
				.. '[[Κατηγορία:' .. write_cat .. ' ' .. apota_text  .. ' (' .. languages[lang_iso].host_name  .. ')|' .. languages[lang_iso].host_key.. ']]' .. "\n"
				.. '[[Κατηγορία:' .. write_cat .. ' (' .. languages[lang_iso].name  .. ')|' .. languages[lang_iso2]['key'] .. ']]' .. "\n"
				.. '[[Κατηγορία:Δανεισμοί ' .. apota_text .. ' (' .. languages[lang_iso].name .. ')| ' .. write_cat .. ']]' .. "\n" -- sort top
				end
			-- sublang (lang other) -- Κατηγορία:Δάνεια από την ελληνιστική κοινή (νέα ελληνικά)
			-- sublang (lang same) -- 
			elseif languages[lang_iso2].sublang == true and not languages[lang_iso].sublang == true then
				if nohost == '1' or languages[lang_iso2].host_iso == languages[lang_iso].iso then
				cat = '[[Κατηγορία:' .. write_cat .. ' ' .. apota_text  .. '|' .. languages[lang_iso].key.. ']]' .. "\n"
				.. '[[Κατηγορία:' .. write_cat .. ' (' .. languages[lang_iso].name  .. ')|' .. languages[lang_iso2].key .. ']]' .. "\n"
				.. '[[Κατηγορία:Δανεισμοί ' .. apota_text .. ' (' .. languages[lang_iso].name .. ')| ' .. write_cat .. ']]' .. "\n" -- sort top
				else
				cat = '[[Κατηγορία:' .. write_cat .. ' ' .. apota_text  .. '|' .. languages[lang_iso]['key'].. ']]' .. "\n"
				.. '[[Κατηγορία:' .. write_cat .. ' ' .. languages[lang_iso2].host_apota .. ' (' .. languages[lang_iso].name .. ')|' .. languages[lang_iso2].apota_key .. ']]' .. "\n"
				.. '[[Κατηγορία:' .. write_cat .. ' (' .. languages[lang_iso].name  .. ')|' .. languages[lang_iso].key .. ']]' .. "\n"	-- sort top
				.. '[[Κατηγορία:Δανεισμοί ' .. apota_text .. ' (' .. languages[lang_iso].name .. ')| ' .. write_cat .. ']]' .. "\n" -- sort top
				end
			-- sublang (sublang other) -- Κατηγορία:Δάνεια από την ελληνιστική κοινή (νεολατινικά)
			-- sublang (sublang same)
			elseif languages[lang_iso].sublang == true and  languages[lang_iso2].sublang == true then
				if nohost == '1' or languages[lang_iso].host_iso == languages[lang_iso2].host_iso then
				cat = '[[Κατηγορία:' .. write_cat .. ' ' .. apota_text  .. '|' .. languages[lang_iso]['key'].. ']]' .. "\n"
				.. '[[Κατηγορία:' .. write_cat .. ' (' .. languages[lang_iso].name .. ')|' .. languages[lang_iso2]['key'] .. ']]' .. "\n"
				.. '[[Κατηγορία:Δανεισμοί ' .. apota_text .. ' (' .. languages[lang_iso].name .. ')| ' .. write_cat .. ']]' .. "\n" -- sort top
				else
				cat = '[[Κατηγορία:' .. write_cat .. ' ' .. apota_text  .. '|' .. languages[lang_iso]['key'].. ']]' .. "\n"
				.. '[[Κατηγορία:' .. write_cat .. ' ' .. apota_text  .. ' (' .. languages[lang_iso].host_name  .. ')|' .. languages[lang_iso].host_key.. ']]' .. "\n"
				.. '[[Κατηγορία:' .. write_cat .. ' ' .. languages[lang_iso2].host_apota .. ' (' .. languages[lang_iso].name .. ')|' .. languages[lang_iso2].apota_key .. ']]' .. "\n"
				.. '[[Κατηγορία:' .. write_cat .. ' (' .. languages[lang_iso].name .. ')|' .. languages[lang_iso2]['key'] .. ']]' .. "\n"
				.. '[[Κατηγορία:Δανεισμοί ' .. apota_text .. ' (' .. languages[lang_iso].name .. ')| ' .. write_cat .. ']]' .. "\n" -- sort top
				end
			-- lang (lang other) -- [[:Κατηγορία:Δάνεια από τα αγγλικά (νέα ελληνικά)]] -- [[:Κατηγορία:Μεταφραστικά δάνεια από τα λατινικά (αλβανικά)]]
			-- lang (lang same) -- Κατηγορία:Λόγια δάνεια από τα αρχαία ελληνικά (νέα ελληνικά)
			else
				cat = '[[Κατηγορία:' .. write_cat .. ' ' .. apota_text  .. '|' .. languages[lang_iso]['key'].. ']]' .. "\n"
				.. '[[Κατηγορία:' .. write_cat .. ' (' .. languages[lang_iso].name  .. ')|' .. languages[lang_iso2].key .. ']]' .. "\n" 
				.. '[[Κατηγορία:Δανεισμοί ' .. apota_text .. ' (' .. languages[lang_iso].name .. ')| ' .. write_cat .. ']]' .. "\n" -- sort top
			end	

		end -- close cat_parenthesis
	end -- close APOTA+BORROWING.KINDS 'Δανεισμοί'

	
-- APOTA.LEARNEDBORROWINGS + λδδ/λενδ level_3 ========= με parent = Λόγια δάνεια
-- test [[:Κατηγορία:Λόγια διαχρονικά δάνεια από τα αρχαία ελληνικά]]
	if mw.ustring.find(cat_title, 'από') and (mw.ustring.find(cat_title, 'Λόγια διαχρονικά δάνεια') or mw.ustring.find(cat_title, 'Λόγια ενδογενή δάνεια')) then
		lang_iso2 = get_apota(apota_text)
		apota_text = get_apota_text(cat_title)
		apota_label = get_apota_label(cat_title)
		
--		write_text = '' == $?what is this
		if mw.ustring.find(cat_title, 'Λόγια διαχρονικά δάνεια') then write_cat = 'Λόγια διαχρονικά δάνεια' end 
		if mw.ustring.find(cat_title, 'Λόγια ενδογενή δάνεια') then write_cat = 'Λόγια ενδογενή δάνεια' end 
		
		if write_cat ~= '' and write_cat ~= nil then
-- a mode
			if cat_parenthesis == '' or cat_parenthesis == nil then
				text = text_wikt .. ' » [[:Κατηγορία:Ετυμολογία|Ετυμολογία]]'
				.. ' » [[:Κατηγορία:Δανεισμοί|Δανεισμοί]] » [[:Κατηγορία:Λόγια δάνεια|Λόγια δάνεια]]'
				.. ' » [[:Κατηγορία:' .. apota_label .. '|' .. apota_label .. ']]'
				.. ' » [[:Κατηγορία:' .. cat_title .. '|'  .. languages[lang_iso2].apota .. ']]'
				-- DO NOT PUR HERE if languages[lang_iso].host_iso == languages[lang_iso2].iso then text = text end 
						-- check Κατηγορία:Λόγια διαχρονικά δάνεια από τα νέα ελληνικά
				if languages[lang_iso2].name == 'διάφορες γλώσσες' 
				then text = text
				else
				text = text .. ' « [[:Κατηγορία:Ετυμολογία (' .. languages[lang_iso2].name ..  ')|<i>Ετυμολογία</i>]]'
				.. ' « [[:Κατηγορία:' .. languages[lang_iso2].cat ..  '|<i>' .. mw.getContentLanguage():ucfirst(languages[lang_iso2].name) .. '</i>]]'
				end
				if languages[lang_iso2].sublang == true then -- hypothetical Κατηγορία:Λόγια δάνεια από τα νεολατινικά (ελληνιστική κοινή)
				text = text 
				.. ' « [[:Κατηγορία:' .. languages[lang_iso2].host ..  '|<i>' .. mw.getContentLanguage():ucfirst(languages[lang_iso2].host_name) .. '</i>]]'
				end	
-- sublangsISO2:host row, e.g. [[:Κατηγορία:Λόγια διαχρονικά δάνεια από την ελληνιστική κοινή]] + από τα αρχαία ελληνικά
		if languages[lang_iso2].sublang == true then
		if nohost == '1' then		
			text = text
		else -- DO NOT 	if languages[lang_iso].host_iso == languages[lang_iso2].iso then
					--  Κατηγορία:Λόγια διαχρονικά δάνεια - τοπωνύμια από την καθαρεύουσα
			text = text .. ' <dl><dd>« [[:Κατηγορία:' .. write_cat .. ' ' .. languages[lang_iso2].host_apota  .. ']]</dd></dl>'
		end -- close nohost
		end -- close if sublang
						
				-- cat a
				-- [[:Κατηγορία:Λόγια διαχρονικά δάνεια από την ελληνιστική κοινή]]
				if languages[lang_iso2].sublang then
					-- considering to deactivate it? 
					if nohost == '1' then
					cat = '[[Κατηγορία:' .. apota_label .. ' (' .. languages[lang_iso2].name .. ')|' .. "'" .. ']]' .. "\n"
					.. '[[Κατηγορία:Λόγια δάνεια ' .. apota_text .. '|' .. languages[lang_iso2].apota_key .. ']]' .. "\n"
					else -- DO NOT  	if languages[lang_iso].host_iso == languages[lang_iso2].iso then
						cat = '[[Κατηγορία:' .. apota_label .. ' (' .. languages[lang_iso2].name .. ')|' .. "'" .. ']]' .. "\n"
						.. '[[Κατηγορία:' .. write_cat .. ' ' .. languages[lang_iso2].host_apota .. '|' .. languages[lang_iso2].apota_key .. ']]' .. "\n"
						.. '[[Κατηγορία:Λόγια δάνεια ' .. apota_text .. '|' .. languages[lang_iso2].apota_key .. ']]' .. "\n"
					end
				else
					cat = '[[Κατηγορία:' .. apota_label .. ' (' .. languages[lang_iso2].name  .. ')|' .. "'" .. ']]' .. "\n"
					.. '[[Κατηγορία:Λόγια δάνεια ' .. apota_text  .. '| ' .. cat_title ..  ']]' .. "\n" -- sort top -- $???? NOT POSSIBLE data.label[write_text]['key']
				end
-- b mode
			else

				text = text_lang ..  ' » [[:Κατηγορία:Ετυμολογία (' ..	lang_name .. ')|Ετυμολογία]]'
				.. ' » [[:Κατηγορία:Δανεισμοί (' ..	lang_name .. ')|Δανεισμοί]]'
				.. ' » [[:Κατηγορία:Λόγια δάνεια (' ..	lang_name .. ')|Λόγια δάνεια]]'
				.. ' » [[:Κατηγορία:' .. apota_label .. ' (' ..	lang_name .. ')|' .. apota_label .. ']]'
				.. ' » [[:Κατηγορία:' .. page_text .. '|' .. languages[lang_iso2].apota .. ']]'
				if languages[lang_iso].iso == languages[lang_iso2].iso -- like grc from grc
				or languages[lang_iso2].name == 'διάφορες γλώσσες'
				then
					text = text
				else text = text
				.. ' « [[:Κατηγορία:Ετυμολογία (' .. languages[lang_iso2].name ..  ')|<i>Ετυμολογία</i>]]'
				.. ' « [[:Κατηγορία:' .. languages[lang_iso2].cat ..  '|<i>' .. mw.getContentLanguage():ucfirst(languages[lang_iso2].name) .. '</i>]]'
				end
				-- Κατηγορία:Λόγια διαχρονικά δάνεια από την ελληνιστική κοινή (καθαρεύουσα)
				if languages[lang_iso2].sublang == true then
				text = text 
				.. ' « [[:Κατηγορία:' .. languages[lang_iso2].host ..  '|<i>' .. mw.getContentLanguage():ucfirst(languages[lang_iso2].host_name) .. '</i>]]'
				end	
-- sublangs:host row, e.g. [[:Κατηγορία:Λόγια δάνεια από την ελληνιστική κοινή (καθαρεύουσα)]]
		-- Κατηγορία:Λόγια διαχρονικά δάνεια από την ελληνιστική κοινή (καθαρεύουσα)
		if languages[lang_iso].sublang == true then
		if nohost == '1' then		
			text = text
		else
			if languages[lang_iso].host_iso == languages[lang_iso2].iso then
			text = text
			else
			text = text .. ' <dl><dd>« [[:Κατηγορία:' .. write_cat .. ' ' .. apota_text  .. ' (' .. languages[lang_iso].host_name  .. ')]]</dd></dl>' 
			end
		end -- close nohost
		end -- close if sublang
			

				-- cat b
				-- [[:Κατηγορία:Λόγια διαχρονικά δάνεια από τα αρχαία ελληνικά (καθαρεύουσα)]]
				if languages[lang_iso].sublang == true and not languages[lang_iso2].sublang == true then
					if nohost == '1' then
					cat = '[[Κατηγορία:' .. write_cat .. ' ' .. apota_text  .. '|' .. languages[lang_iso]['key'].. ']]' .. "\n"
					.. '[[Κατηγορία:Λόγια δάνεια ' .. apota_text .. ' (' .. languages[lang_iso].name  .. ')| ' .. languages[lang_iso2]['key'] .. ']]' .. "\n"			
					else
						if languages[lang_iso].host_iso == languages[lang_iso2].iso then
						cat = '[[Κατηγορία:' .. write_cat .. ' ' .. apota_text  .. '|' .. languages[lang_iso]['key'].. ']]' .. "\n"
						.. '[[Κατηγορία:Λόγια δάνεια ' .. apota_text .. ' (' .. languages[lang_iso].name  .. ')| ' .. languages[lang_iso2]['key'] .. ']]' .. "\n"
						else
						cat = '[[Κατηγορία:' .. write_cat .. ' ' .. apota_text  .. '|' .. languages[lang_iso]['key'].. ']]' .. "\n"
						.. '[[Κατηγορία:' .. write_cat .. ' ' .. apota_text  .. ' (' .. languages[lang_iso].host_name  .. ')|' .. languages[lang_iso].host_key.. ']]' .. "\n"
						.. '[[Κατηγορία:Λόγια δάνεια ' .. apota_text .. ' (' .. languages[lang_iso].name  .. ')| ' .. languages[lang_iso2]['key'] .. ']]' .. "\n"
						end
					end
				-- [[:Κατηγορία:Λόγια διαχρονικά δάνεια από την ελληνιστική κοινή (νέα ελληνικά)]]
				elseif languages[lang_iso2].sublang == true and not languages[lang_iso].sublang == true then
					cat = '[[Κατηγορία:' .. write_cat .. ' ' .. apota_text  .. '|' .. languages[lang_iso]['key'].. ']]' .. "\n"
					.. '[[Κατηγορία:' .. write_cat .. ' ' .. languages[lang_iso2].host_apota .. ' (' .. languages[lang_iso].name .. ')|' .. languages[lang_iso2].apota_key .. ']]' .. "\n"
					.. '[[Κατηγορία:Λόγια δάνεια ' .. apota_text .. ' (' .. languages[lang_iso].name  .. ')| ' .. languages[lang_iso].key .. ']]' .. "\n"	
				-- [[:Κατηγορία:Λόγια διαχρονικά δάνεια από την ελληνιστική κοινή (καθαρεύουσα)]]
				elseif languages[lang_iso].sublang == true and languages[lang_iso2].sublang == true then
					if nohost == '1' then
					cat = '[[Κατηγορία:' .. write_cat .. ' ' .. apota_text  .. '|' .. languages[lang_iso]['key'].. ']]' .. "\n"
					.. '[[Κατηγορία:' .. write_cat .. ' ' .. languages[lang_iso2].host_apota .. ' (' .. languages[lang_iso].name .. ')|' .. languages[lang_iso2].apota_key .. ']]' .. "\n"
					.. '[[Κατηγορία:Λόγια δάνεια ' .. apota_text .. ' (' .. languages[lang_iso].name  .. ')| ' .. languages[lang_iso2]['key'] .. ']]' .. "\n"		
					else
						if languages[lang_iso].host_iso == languages[lang_iso2].iso then
						cat = '[[Κατηγορία:' .. write_cat .. ' ' .. apota_text  .. '|' .. languages[lang_iso]['key'].. ']]' .. "\n"
						.. '[[Κατηγορία:Λόγια δάνεια ' .. apota_text .. ' (' .. languages[lang_iso].name  .. ')| ' .. languages[lang_iso2]['key'] .. ']]' .. "\n"
						else
						cat = '[[Κατηγορία:' .. write_cat .. ' ' .. apota_text  .. '|' .. languages[lang_iso]['key'].. ']]' .. "\n"
						.. '[[Κατηγορία:' .. write_cat .. ' ' .. apota_text  .. ' (' .. languages[lang_iso].host_name  .. ')|' .. languages[lang_iso].host_key.. ']]' .. "\n"
						.. '[[Κατηγορία:' .. write_cat .. ' ' .. languages[lang_iso2].host_apota .. ' (' .. languages[lang_iso].name .. ')|' .. languages[lang_iso2].apota_key .. ']]' .. "\n"
						.. '[[Κατηγορία:Λόγια δάνεια ' .. apota_text .. ' (' .. languages[lang_iso].name  .. ')| ' .. languages[lang_iso2]['key'] .. ']]' .. "\n"
						end
					end
				-- [[:Κατηγορία:Λόγια διαχρονικά δάνεια από τα αρχαία ελληνικά (νέα ελληνικά)]]
				else
					cat = '[[Κατηγορία:' .. write_cat .. ' ' .. apota_text  .. '|' .. languages[lang_iso]['key'].. ']]' .. "\n"
					.. '[[Κατηγορία:' .. write_cat .. ' (' .. languages[lang_iso].name  .. ')|' .. languages[lang_iso]['key'].. ']]' .. "\n"
					.. '[[Κατηγορία:Λόγια δάνεια ' .. apota_text .. ' (' .. languages[lang_iso].name  .. ')| ' .. languages[lang_iso2].key .. ']]' .. "\n"
				end	
				
			end -- close cat_parenthesis
		end -- close if write_cat
	end -- close write_cat apota with parent = 'Λόγια δάνεια'


--------------------------------------------------------------------------
--     apota + ProperNoun name/suname/placename +Κύριο όνομα όπως όνομα/επώνυμο/τοπωνύμιο                      --
--------------------------------------------------------------------------	
-- APOTA + Δάνεια + ονόματα/επών/ανθρωπ/τοπωνύμια level_3 ========= parent = Δάνεια
--  [[:Κατηγορία:Δάνεια - ονόματα από τα αρχαία περσικά]]
	if mw.ustring.find(cat_title, 'από') and mw.ustring.find(cat_title, 'Δάνεια') and mw.ustring.find(cat_title, '-') then
		lang_iso2 = get_apota(apota_text)
		apota_text = get_apota_text(cat_title)
		apota_label = get_apota_label(cat_title)
		
		write_text = ''
		if mw.ustring.find(cat_title, 'ονόματα') then write_cat = 'Δάνεια - ονόματα' end 
		if mw.ustring.find(cat_title, 'επώνυμα') then write_cat = 'Δάνεια - επώνυμα' end 
		if mw.ustring.find(cat_title, 'ανθρωπωνύμια') then write_cat = 'Δάνεια - ανθρωπωνύμια' end 
		if mw.ustring.find(cat_title, 'τοπωνύμια') then write_cat = 'Δάνεια - τοπωνύμια' end 
		
		if write_cat ~= '' and write_cat ~= nil then
-- a mode $???? --------- do I need the keys of level_2 ? -------------
			if cat_parenthesis == '' or cat_parenthesis == nil then
				text = text_wikt .. ' » [[:Κατηγορία:Ετυμολογία|Ετυμολογία]]' 
				.. ' » [[:Κατηγορία:Δανεισμοί|Δανεισμοί]] » [[:Κατηγορία:Δάνεια|Δάνεια]]  ' .. textit
				-- DO NOT PUT HERE if languages[lang_iso].host_iso == languages[lang_iso2].iso -- Κατηγορία:Δάνεια - επώνυμα από τα αγγλικά
				if languages[lang_iso2].name == 'διάφορες γλώσσες' then 
				text = text
				else
				text = text
				.. ' « [[:Κατηγορία:Ετυμολογία (' .. languages[lang_iso2].name ..  ')|<i>Ετυμολογία</i>]]'
				.. ' « [[:Κατηγορία:' .. languages[lang_iso2].cat ..  '|<i>' .. mw.getContentLanguage():ucfirst(languages[lang_iso2].name) .. '</i>]]'
				end
-- $$addsublang		
				
				-- cat a
				-- [[:Κατηγορία:Δάνεια - ονόματα από την ελληνιστική κοινή]] -- [[:Κατηγορία:Δάνεια - ονόματα από τα αρχαία περσικά]]
				if languages[lang_iso2].sublang then
					cat = '[[Κατηγορία:' .. apota_label .. ' (' .. languages[lang_iso2].name .. ')|' .. "'" .. ']]' .. "\n"
					.. '[[Κατηγορία:' .. write_cat .. ' ' .. languages[lang_iso2].host_apota .. '|' .. languages[lang_iso2].apota_key .. ']]' .. "\n"
				else
					cat = '[[Κατηγορία:' .. apota_label .. ' (' .. languages[lang_iso2].name  .. ')|' .. "'" .. ']]' .. "\n"
					.. '[[Κατηγορία:Δάνεια ' .. apota_text  .. '| ' .. cat_title ..  ']]' .. "\n" -- sort top -- ???? NOT POSSIBLE data.label[write_text]['key']
				end
-- b mode
			else

				text = text_lang ..  ' » [[:Κατηγορία:Ετυμολογία (' ..	lang_name .. ')|Ετυμολογία]]'
				.. ' » [[:Κατηγορία:Δανεισμοί (' ..	lang_name .. ')|Δανεισμοί]]'
				.. ' » [[:Κατηγορία:Δάνεια (' ..	lang_name .. ')|Δάνεια]] ' .. textit_lang
		-- Κατηγορία:Μεταγραμμένοι όροι - ονόματα από διάφορες γλώσσες (νέα ελληνικά)	
			-- Κατηγορία:Δάνεια - επώνυμα από τα ποντιακά (νέα ελληνικά)
				if languages[lang_iso].host_iso == languages[lang_iso2].iso
				or languages[lang_iso2].name == 'διάφορες γλώσσες' then
				text = text
				else
				text = text	
				.. ' « [[:Κατηγορία:Ετυμολογία (' .. languages[lang_iso2].name ..  ')|<i>Ετυμολογία</i>]]'
				.. ' « [[:Κατηγορία:' .. languages[lang_iso2].cat ..  '|<i>' .. mw.getContentLanguage():ucfirst(languages[lang_iso2].name) .. '</i>]]'
					-- Κατηγορία:Δάνεια - επώνυμα από τα ποντιακά (νέα ελληνικά)
					if languages[lang_iso2].sublang == true then
					text = text 
					.. ' « [[:Κατηγορία:' .. languages[lang_iso2].host ..  '|<i>' .. mw.getContentLanguage():ucfirst(languages[lang_iso2].host_name) .. '</i>]]'
					end	
				end
-- sublangs:host row, 
		if languages[lang_iso].sublang == true then
		if nohost == '1'  then		
			text = text
		else
			if languages[lang_iso].host_iso == languages[lang_iso2].iso then
			text = text
			else
			text = text .. ' <dl><dd>« [[:Κατηγορία:' .. write_cat .. ' ' .. apota_text  .. ' (' .. languages[lang_iso].host_name  .. ')]]</dd></dl>'
			end
		end -- close nohost
		end -- close if sublang
				
-- sublangOK			
				
				-- cat b
				-- [[:Κατηγορία:Δάνεια - ονόματα από τα αρχαία ελληνικά (νεολατινικά)]]
				if languages[lang_iso].sublang == true and not languages[lang_iso2].sublang == true then
					if nohost == '1' then
						cat = '[[Κατηγορία:' .. write_cat .. ' ' .. apota_text  .. '|' .. languages[lang_iso]['key'].. ']]' .. "\n"
						.. '[[Κατηγορία:' .. write_cat .. ' (' .. languages[lang_iso].name  .. ')|' .. languages[lang_iso2].key .. ']]' .. "\n"			
					else
						if languages[lang_iso].host_iso == languages[lang_iso2].iso then
						cat = '[[Κατηγορία:' .. write_cat .. ' ' .. apota_text  .. '|' .. languages[lang_iso]['key'].. ']]' .. "\n"
						.. '[[Κατηγορία:' .. write_cat .. ' (' .. languages[lang_iso].name  .. ')|' .. languages[lang_iso2].key .. ']]' .. "\n"	
						else
						cat = '[[Κατηγορία:' .. write_cat .. ' ' .. apota_text  .. '|' .. languages[lang_iso]['key'].. ']]' .. "\n"
						.. '[[Κατηγορία:' .. write_cat .. ' ' .. apota_text  .. ' (' .. languages[lang_iso].host_name  .. ')|' .. languages[lang_iso].host_key.. ']]' .. "\n"
						.. '[[Κατηγορία:' .. write_cat .. ' (' .. languages[lang_iso].name  .. ')|' .. languages[lang_iso2].key .. ']]' .. "\n"	
						end
					end
				-- [[:Κατηγορία:Δάνεια - ονόματα από τα μεσαιωνικά λατινικά (αγγλικά)]]
				-- Κατηγορία:Δάνεια - επώνυμα από τα ποντιακά (νέα ελληνικά)
				elseif languages[lang_iso2].sublang == true and not languages[lang_iso].sublang == true then
					if nohost == '1' then
						cat = '[[Κατηγορία:' .. write_cat .. ' ' .. apota_text  .. '|' .. languages[lang_iso]['key'].. ']]' .. "\n"
					else
						if languages[lang_iso].host_iso == languages[lang_iso2].iso then
						cat = '[[Κατηγορία:' .. write_cat .. ' ' .. apota_text  .. '|' .. languages[lang_iso]['key'].. ']]' .. "\n"
						else
						cat = '[[Κατηγορία:' .. write_cat .. ' ' .. apota_text  .. '|' .. languages[lang_iso]['key'].. ']]' .. "\n"
						.. '[[Κατηγορία:' .. write_cat .. ' ' .. languages[lang_iso2].host_apota .. ' (' .. languages[lang_iso].name .. ')|' .. languages[lang_iso2].apota_key .. ']]' .. "\n"
						end
					end
				-- [[:Κατηγορία:Δάνεια - ονόματα από τα μεσαιωνικά λατινικά (ελληνιστική κοινή)]]
				elseif languages[lang_iso].sublang == true and languages[lang_iso2].sublang == true then
					if nohost == '1' then
						cat = '[[Κατηγορία:' .. write_cat .. '|' .. languages[lang_iso]['key'].. ']]' .. "\n"
						.. '[[Κατηγορία:' .. write_cat .. ' ' .. apota_text  .. '|' .. languages[lang_iso]['key'].. ']]' .. "\n"
						.. '[[Κατηγορία:' .. write_cat .. ' (' .. languages[lang_iso].name  .. ')|' .. languages[lang_iso2]['key'] .. ']]' .. "\n"
					else
						if languages[lang_iso].host_iso == languages[lang_iso2].iso then
						cat = '[[Κατηγορία:' .. write_cat .. '|' .. languages[lang_iso]['key'].. ']]' .. "\n"
						.. '[[Κατηγορία:' .. write_cat .. ' ' .. apota_text  .. '|' .. languages[lang_iso]['key'].. ']]' .. "\n"
						.. '[[Κατηγορία:' .. write_cat .. ' (' .. languages[lang_iso].name  .. ')|' .. languages[lang_iso2]['key'] .. ']]' .. "\n"			
						else
						cat = '[[Κατηγορία:' .. write_cat .. '|' .. languages[lang_iso]['key'].. ']]' .. "\n"
						.. '[[Κατηγορία:' .. write_cat .. ' ' .. apota_text  .. '|' .. languages[lang_iso]['key'].. ']]' .. "\n"
						.. '[[Κατηγορία:' .. write_cat .. ' ' .. apota_text  .. ' (' .. languages[lang_iso].host_name  .. ')|' .. languages[lang_iso].host_key.. ']]' .. "\n"
						.. '[[Κατηγορία:' .. write_cat .. ' ' .. languages[lang_iso2].host_apota .. ' (' .. languages[lang_iso].name .. ')|' .. languages[lang_iso2].apota_key .. ']]' .. "\n"
						.. '[[Κατηγορία:' .. write_cat .. ' (' .. languages[lang_iso].name  .. ')|' .. languages[lang_iso2]['key'] .. ']]' .. "\n"
						end
					end
				-- [[:Κατηγορία:Δάνεια - ονόματα από τα αρχαία ελληνικά (νέα ελληνικά)]]
				else
					cat = '[[Κατηγορία:' .. write_cat .. ' ' .. apota_text  .. '|' .. languages[lang_iso]['key'].. ']]' .. "\n"
--					.. '[[Κατηγορία:' .. write_cat .. ' (' .. languages[lang_iso2].name  .. ')|' .. languages[lang_iso].key .. ']]' .. "\n" -- NO repetition
					.. '[[Κατηγορία:' .. write_cat .. ' (' .. languages[lang_iso].name  .. ')|' .. languages[lang_iso2].key .. ']]' .. "\n"
					.. '[[Κατηγορία:Δάνεια' .. ' ' .. apota_text  .. ' (' .. languages[lang_iso].name .. ')| ]]' .. "\n" -- sort top ??? λέξη επώνυμα, ονόματα κλπ
				end	
				
			end -- close cat_parenthesis
			
		end -- close if write_cat
	end -- close write_cat apota Δάνεια - ονόματα
	
	
-- APOTA + Λόγιο δάνειο + ονόματα/επών/ανθρωπ/τοπωνύμια level_3 ========= parent = Λόγια δάνεια
--  [[Οὐλερῖχος]] [[:Κατηγορία:Λόγια δάνεια - επώνυμα από τα γερμανικά (καθαρεύουσα)]]
	if mw.ustring.find(cat_title, 'από') and mw.ustring.find(cat_title, 'Λόγια δάνεια') and mw.ustring.find(cat_title, '-') then
		lang_iso2 = get_apota(apota_text)
		apota_text = get_apota_text(cat_title)
		apota_label = get_apota_label(cat_title)
		
		write_text = ''
		if mw.ustring.find(cat_title, 'ονόματα') then write_cat = 'Λόγια δάνεια - ονόματα' end 
		if mw.ustring.find(cat_title, 'επώνυμα') then write_cat = 'Λόγια δάνεια - επώνυμα' end 
		if mw.ustring.find(cat_title, 'ανθρωπωνύμια') then write_cat = 'Λόγια δάνεια - ανθρωπωνύμια' end 
		if mw.ustring.find(cat_title, 'τοπωνύμια') then write_cat = 'Λόγια δάνεια - τοπωνύμια' end 
		
		if write_cat ~= '' and write_cat ~= nil then
-- a mode ???? --------- do I need the keys of level_2 ? -------------
			if cat_parenthesis == '' or cat_parenthesis == nil then
				text = text_wikt .. ' » [[:Κατηγορία:Ετυμολογία|Ετυμολογία]]' 
				.. ' » [[:Κατηγορία:Δανεισμοί|Δανεισμοί]] » [[:Κατηγορία:Λόγια δάνεια|Λόγια δάνεια]]  ' .. textit
				-- DO NOT PUT if languages[lang_iso].host_iso == languages[lang_iso2].iso Κατηγορία:Λόγια δάνεια - επώνυμα από τα αγγλικά
				if languages[lang_iso2].name == 'διάφορες γλώσσες' then
				text = text
				else
				text = text 
				.. ' « [[:Κατηγορία:Ετυμολογία (' .. languages[lang_iso2].name ..  ')|<i>Ετυμολογία</i>]]'
				.. ' « [[:Κατηγορία:' .. languages[lang_iso2].cat ..  '|<i>' .. mw.getContentLanguage():ucfirst(languages[lang_iso2].name) .. '</i>]]'	
				end
-- $addsublang		
				-- cat a
				if languages[lang_iso2].sublang then
					cat = '[[Κατηγορία:' .. apota_label .. ' (' .. languages[lang_iso2].name .. ')|' .. "'" .. ']]' .. "\n"
					.. '[[Κατηγορία:' .. write_cat .. ' ' .. languages[lang_iso2].host_apota .. '|' .. languages[lang_iso2].apota_key .. ']]' .. "\n"
				else
					cat = '[[Κατηγορία:' .. apota_label .. ' (' .. languages[lang_iso2].name  .. ')|' .. "'" .. ']]' .. "\n"
					.. '[[Κατηγορία:Λόγια δάνεια ' .. apota_text  .. '| ' .. cat_title ..  ']]' .. "\n" -- sort top -- ???? NOT POSSIBLE data.label[write_text]['key']
				end

-- b mode
			else

				text = text_lang ..  ' » [[:Κατηγορία:Ετυμολογία (' ..	lang_name .. ')|Ετυμολογία]]'
				.. ' » [[:Κατηγορία:Δανεισμοί (' ..	lang_name .. ')|Δανεισμοί]]'
				.. ' » [[:Κατηγορία:Λόγια δάνεια (' ..	lang_name .. ')|Λόγια δάνεια]] ' .. textit_lang
				if languages[lang_iso].host_iso == languages[lang_iso2].iso
				or languages[lang_iso2].name == 'διάφορες γλώσσες' then text = text
				else
				text = text 	
				.. ' « [[:Κατηγορία:Ετυμολογία (' .. languages[lang_iso2].name ..  ')|<i>Ετυμολογία</i>]]'
				.. ' « [[:Κατηγορία:' .. languages[lang_iso2].cat ..  '|<i>' .. mw.getContentLanguage():ucfirst(languages[lang_iso2].name) .. '</i>]]'		
				end
-- $addsublang
				
				-- cat b
				if languages[lang_iso].sublang == true and not languages[lang_iso2].sublang == true then
					cat = '[[Κατηγορία:' .. write_cat .. ' ' .. apota_text  .. '|' .. languages[lang_iso]['key'].. ']]' .. "\n"
					.. '[[Κατηγορία:' .. write_cat .. ' ' .. apota_text  .. ' (' .. languages[lang_iso].host_name  .. ')|' .. languages[lang_iso].host_key.. ']]' .. "\n"
					.. '[[Κατηγορία:' .. write_cat .. ' (' .. languages[lang_iso].name  .. ')|' .. languages[lang_iso2].key .. ']]' .. "\n"	
				elseif languages[lang_iso2].sublang == true and not languages[lang_iso].sublang == true then
					cat = '[[Κατηγορία:' .. write_cat .. ' ' .. apota_text  .. '|' .. languages[lang_iso]['key'].. ']]' .. "\n"
					.. '[[Κατηγορία:' .. write_cat .. ' ' .. languages[lang_iso2].host_apota .. ' (' .. languages[lang_iso].name .. ')|' .. languages[lang_iso2].apota_key .. ']]' .. "\n"
				elseif languages[lang_iso].sublang == true and  languages[lang_iso2].sublang == true then
					cat = '[[Κατηγορία:' .. write_cat .. '|' .. languages[lang_iso]['key'].. ']]' .. "\n"
					.. '[[Κατηγορία:' .. write_cat .. ' ' .. apota_text  .. '|' .. languages[lang_iso]['key'].. ']]' .. "\n"
					.. '[[Κατηγορία:' .. write_cat .. ' ' .. apota_text  .. ' (' .. languages[lang_iso].host_name  .. ')|' .. languages[lang_iso].host_key.. ']]' .. "\n"
					.. '[[Κατηγορία:' .. write_cat .. ' ' .. languages[lang_iso2].host_apota .. ' (' .. languages[lang_iso].name .. ')|' .. languages[lang_iso2].apota_key .. ']]' .. "\n"
					.. '[[Κατηγορία:' .. write_cat .. ' (' .. languages[lang_iso].name  .. ')|' .. languages[lang_iso2]['key'] .. ']]' .. "\n"
				else
					cat = '[[Κατηγορία:' .. write_cat .. ' ' .. apota_text  .. '|' .. languages[lang_iso]['key'].. ']]' .. "\n"
					.. '[[Κατηγορία:' .. write_cat .. ' (' .. languages[lang_iso2].name  .. ')|' .. languages[lang_iso].key .. ']]' .. "\n"
					.. '[[Κατηγορία:' .. write_cat .. ' (' .. languages[lang_iso].name  .. ')|' .. languages[lang_iso2].key .. ']]' .. "\n"
					.. '[[Κατηγορία:Λόγια δάνεια' .. ' ' .. apota_text  .. ' (' .. languages[lang_iso].name .. ')| ]]' .. "\n" -- sort top ??? λέξη επώνυμα, ονόματα κλπ
				end	
				
			end -- close cat_parenthesis
			
		end -- close if write_cat
	end -- close write_cat apota Λόγιο δάνειο - ονόματα κλπ
	
	
	
-- APOTA + Λόγιο διαχρονικό δάνειο + ονόματα/επών/ανθρωπ/τοπωνύμια level_3 ========= parent = Λόγια δάνεια
--  [[Ατλαντίδα]]] [[:Κατηγορία:Λόγια διαχρονικά δάνεια - τοπωνύμια από τα αρχαία ελληνικά (νέα ελληνικά)]]
	if mw.ustring.find(cat_title, 'από') and mw.ustring.find(cat_title, 'Λόγια διαχρονικά δάνεια') and mw.ustring.find(cat_title, '-') then
		lang_iso2 = get_apota(apota_text)
		apota_text = get_apota_text(cat_title)
		apota_label = get_apota_label(cat_title)
		
		write_text = ''
		if mw.ustring.find(cat_title, 'ονόματα') then write_cat = 'Λόγια διαχρονικά δάνεια - ονόματα' end 
		if mw.ustring.find(cat_title, 'επώνυμα') then write_cat = 'Λόγια διαχρονικά δάνεια - επώνυμα' end 
		if mw.ustring.find(cat_title, 'ανθρωπωνύμια') then write_cat = 'Λόγια διαχρονικά δάνεια - ανθρωπωνύμια' end 
		if mw.ustring.find(cat_title, 'τοπωνύμια') then write_cat = 'Λόγια διαχρονικά δάνεια - τοπωνύμια' end 
		
		if write_cat ~= '' and write_cat ~= nil then
-- a mode ???? --------- do I need the keys of level_2 ? -------------
			if cat_parenthesis == '' or cat_parenthesis == nil then
				text = text_wikt .. ' » [[:Κατηγορία:Ετυμολογία|Ετυμολογία]]' 
				.. ' » [[:Κατηγορία:Δανεισμοί|Δανεισμοί]] » [[:Κατηγορία:Λόγια δάνεια|Λόγια δάνεια]]  ' .. textit
				-- DO NOT if languages[lang_iso].host_iso == languages[lang_iso2].iso Κατηγορία:Λόγια διαχρονικά δάνεια - τοπωνύμια από τα αρχαία ελληνικά
				if languages[lang_iso2].name == 'διάφορες γλώσσες' then
				text = text
				else
				text = text 	
				.. ' « [[:Κατηγορία:Ετυμολογία (' .. languages[lang_iso2].name ..  ')|<i>Ετυμολογία</i>]]'
				.. ' « [[:Κατηγορία:' .. languages[lang_iso2].cat ..  '|<i>' .. mw.getContentLanguage():ucfirst(languages[lang_iso2].name) .. '</i>]]'	
				end
-- $addsublang
				
				-- cat a
				if languages[lang_iso2].sublang then
					cat = '[[Κατηγορία:' .. apota_label .. ' (' .. languages[lang_iso2].name .. ')|' .. "'" .. ']]' .. "\n"
					.. '[[Κατηγορία:' .. write_cat .. ' ' .. languages[lang_iso2].host_apota .. '|' .. languages[lang_iso2].apota_key .. ']]' .. "\n"
				else
					cat = '[[Κατηγορία:' .. apota_label .. ' (' .. languages[lang_iso2].name  .. ')|' .. "'" .. ']]' .. "\n"
					.. '[[Κατηγορία:Λόγια διαχρονικά δάνεια ' .. apota_text  .. '| ' .. cat_title ..  ']]' .. "\n" -- sort top -- ???? NOT POSSIBLE data.label[write_text]['key']
				end
-- b mode
			else

				text = text_lang ..  ' » [[:Κατηγορία:Ετυμολογία (' ..	lang_name .. ')|Ετυμολογία]]'
				.. ' » [[:Κατηγορία:Δανεισμοί (' ..	lang_name .. ')|Δανεισμοί]]'
				.. ' » [[:Κατηγορία:Λόγια δάνεια (' ..	lang_name .. ')|Λόγια δάνεια]] ' .. textit_lang
				if languages[lang_iso].host_iso == languages[lang_iso2].iso
				or languages[lang_iso2].name == 'διάφορες γλώσσες' then text = text
				else
				text = text 	
				.. ' « [[:Κατηγορία:Ετυμολογία (' .. languages[lang_iso2].name ..  ')|<i>Ετυμολογία</i>]]'
				.. ' « [[:Κατηγορία:' .. languages[lang_iso2].cat ..  '|<i>' .. mw.getContentLanguage():ucfirst(languages[lang_iso2].name) .. '</i>]]'		
				end
-- $addsublang		
				-- cat b
				if languages[lang_iso].sublang == true and not languages[lang_iso2].sublang == true then
					cat = '[[Κατηγορία:' .. write_cat .. ' ' .. apota_text  .. '|' .. languages[lang_iso]['key'].. ']]' .. "\n"
					.. '[[Κατηγορία:' .. write_cat .. ' ' .. apota_text  .. ' (' .. languages[lang_iso].host_name  .. ')|' .. languages[lang_iso].host_key.. ']]' .. "\n"
					.. '[[Κατηγορία:' .. write_cat .. ' (' .. languages[lang_iso].name  .. ')|' .. languages[lang_iso2].key .. ']]' .. "\n"	
				elseif languages[lang_iso2].sublang == true and not languages[lang_iso].sublang == true then
					cat = '[[Κατηγορία:' .. write_cat .. ' ' .. apota_text  .. '|' .. languages[lang_iso]['key'].. ']]' .. "\n"
					.. '[[Κατηγορία:' .. write_cat .. ' ' .. languages[lang_iso2].host_apota .. ' (' .. languages[lang_iso].name .. ')|' .. languages[lang_iso2].apota_key .. ']]' .. "\n"
				elseif languages[lang_iso].sublang == true and  languages[lang_iso2].sublang == true then
					cat = '[[Κατηγορία:' .. write_cat .. '|' .. languages[lang_iso]['key'].. ']]' .. "\n"
					.. '[[Κατηγορία:' .. write_cat .. ' ' .. apota_text  .. '|' .. languages[lang_iso]['key'].. ']]' .. "\n"
					.. '[[Κατηγορία:' .. write_cat .. ' ' .. apota_text  .. ' (' .. languages[lang_iso].host_name  .. ')|' .. languages[lang_iso].host_key.. ']]' .. "\n"
					.. '[[Κατηγορία:' .. write_cat .. ' ' .. languages[lang_iso2].host_apota .. ' (' .. languages[lang_iso].name .. ')|' .. languages[lang_iso2].apota_key .. ']]' .. "\n"
					.. '[[Κατηγορία:' .. write_cat .. ' (' .. languages[lang_iso].name  .. ')|' .. languages[lang_iso2]['key'] .. ']]' .. "\n"
				else
					cat = '[[Κατηγορία:' .. write_cat .. ' ' .. apota_text  .. '|' .. languages[lang_iso]['key'].. ']]' .. "\n"
					.. '[[Κατηγορία:' .. write_cat .. ' (' .. languages[lang_iso2].name  .. ')|' .. languages[lang_iso].key .. ']]' .. "\n"
					.. '[[Κατηγορία:' .. write_cat .. ' (' .. languages[lang_iso].name  .. ')|' .. languages[lang_iso2].key .. ']]' .. "\n"
					.. '[[Κατηγορία:Λόγια διαχρονικά δάνεια' .. ' ' .. apota_text  .. ' (' .. languages[lang_iso].name .. ')| ]]' .. "\n" -- sort top ??? λέξη επώνυμα, ονόματα κλπ
				end	
				
			end -- close cat_parenthesis
			
		end -- close if write_cat
	end -- close write_cat apota Λόγιο διαχρονικό δάνειο - ονόματα κλπ
	
		
	
-- APOTA + Ορθογραφικό δάνειο + ονόματα/επών/ανθρωπ/τοπωνύμια level_3 ========= parent = Ορθογραφικά δάνεια
-- [[Πλόβντιβ]]
	if mw.ustring.find(cat_title, 'από') and mw.ustring.find(cat_title, 'Ορθογραφικά δάνεια') and mw.ustring.find(cat_title, '-') then
		lang_iso2 = get_apota(apota_text)
		apota_text = get_apota_text(cat_title)
		apota_label = get_apota_label(cat_title)
		
		write_text = ''
		if mw.ustring.find(cat_title, 'ονόματα') then write_cat = 'Ορθογραφικά δάνεια - ονόματα' end 
		if mw.ustring.find(cat_title, 'επώνυμα') then write_cat = 'Ορθογραφικά δάνεια - επώνυμα' end 
		if mw.ustring.find(cat_title, 'ανθρωπωνύμια') then write_cat = 'Ορθογραφικά δάνεια - ανθρωπωνύμια' end 
		if mw.ustring.find(cat_title, 'τοπωνύμια') then write_cat = 'Ορθογραφικά δάνεια - τοπωνύμια' end 
		
		if write_cat ~= '' and write_cat ~= nil then
-- a mode ???? --------- do I need the keys of level_2 ? -------------
			if cat_parenthesis == '' or cat_parenthesis == nil then
				text = text_wikt .. ' » [[:Κατηγορία:Ετυμολογία|Ετυμολογία]]' 
				.. ' » [[:Κατηγορία:Δανεισμοί|Δανεισμοί]] » [[:Κατηγορία:Ορθογραφικά δάνεια|Ορθογραφικά δάνεια]]  ' .. textit
				-- DO NOT PUT if languages[lang_iso].host_iso == languages[lang_iso2].iso Κατηγορία:Ορθογραφικά δάνεια - τοπωνύμια από τα γαλλικά
				if languages[lang_iso2].name == 'διάφορες γλώσσες' then text = text
				else
				text = text 		
				.. ' « [[:Κατηγορία:Ετυμολογία (' .. languages[lang_iso2].name ..  ')|<i>Ετυμολογία</i>]]'
				.. ' « [[:Κατηγορία:' .. languages[lang_iso2].cat ..  '|<i>' .. mw.getContentLanguage():ucfirst(languages[lang_iso2].name) .. '</i>]]'	
				end
-- $addsublang
				
				-- cat a
				if languages[lang_iso2].sublang then
					cat = '[[Κατηγορία:' .. apota_label .. ' (' .. languages[lang_iso2].name .. ')|' .. "'" .. ']]' .. "\n"
					.. '[[Κατηγορία:' .. write_cat .. ' ' .. languages[lang_iso2].host_apota .. '|' .. languages[lang_iso2].apota_key .. ']]' .. "\n"
				else
					cat = '[[Κατηγορία:' .. apota_label .. ' (' .. languages[lang_iso2].name  .. ')|' .. "'" .. ']]' .. "\n"
					.. '[[Κατηγορία:Ορθογραφικά δάνεια ' .. apota_text  .. '| ' .. cat_title ..  ']]' .. "\n" -- sort top -- ???? NOT POSSIBLE data.label[write_text]['key']
				end
-- b mode
			else

				text = text_lang ..  ' » [[:Κατηγορία:Ετυμολογία (' ..	lang_name .. ')|Ετυμολογία]]'
				.. ' » [[:Κατηγορία:Δανεισμοί (' ..	lang_name .. ')|Δανεισμοί]]'
				.. ' » [[:Κατηγορία:Ορθογραφικά δάνεια (' ..	lang_name .. ')|Ορθογραφικά δάνεια]] ' .. textit_lang
				if languages[lang_iso].host_iso == languages[lang_iso2].iso
				or languages[lang_iso2].name == 'διάφορες γλώσσες' then
				text = text
				else
				text = text 		
				.. ' « [[:Κατηγορία:Ετυμολογία (' .. languages[lang_iso2].name ..  ')|<i>Ετυμολογία</i>]]'
				.. ' « [[:Κατηγορία:' .. languages[lang_iso2].cat ..  '|<i>' .. mw.getContentLanguage():ucfirst(languages[lang_iso2].name) .. '</i>]]'		
				end
-- $addsublang

				-- cat b
				if languages[lang_iso].sublang == true and not languages[lang_iso2].sublang == true then
					cat = '[[Κατηγορία:' .. write_cat .. ' ' .. apota_text  .. '|' .. languages[lang_iso]['key'].. ']]' .. "\n"
					.. '[[Κατηγορία:' .. write_cat .. ' ' .. apota_text  .. ' (' .. languages[lang_iso].host_name  .. ')|' .. languages[lang_iso].host_key.. ']]' .. "\n"
					.. '[[Κατηγορία:' .. write_cat .. ' (' .. languages[lang_iso].name  .. ')|' .. languages[lang_iso2].key .. ']]' .. "\n"	
				elseif languages[lang_iso2].sublang == true and not languages[lang_iso].sublang == true then
					cat = '[[Κατηγορία:' .. write_cat .. ' ' .. apota_text  .. '|' .. languages[lang_iso]['key'].. ']]' .. "\n"
					.. '[[Κατηγορία:' .. write_cat .. ' ' .. languages[lang_iso2].host_apota .. ' (' .. languages[lang_iso].name .. ')|' .. languages[lang_iso2].apota_key .. ']]' .. "\n"
				elseif languages[lang_iso].sublang == true and  languages[lang_iso2].sublang == true then
					cat = '[[Κατηγορία:' .. write_cat .. '|' .. languages[lang_iso]['key'].. ']]' .. "\n"
					.. '[[Κατηγορία:' .. write_cat .. ' ' .. apota_text  .. '|' .. languages[lang_iso]['key'].. ']]' .. "\n"
					.. '[[Κατηγορία:' .. write_cat .. ' ' .. apota_text  .. ' (' .. languages[lang_iso].host_name  .. ')|' .. languages[lang_iso].host_key.. ']]' .. "\n"
					.. '[[Κατηγορία:' .. write_cat .. ' ' .. languages[lang_iso2].host_apota .. ' (' .. languages[lang_iso].name .. ')|' .. languages[lang_iso2].apota_key .. ']]' .. "\n"
					.. '[[Κατηγορία:' .. write_cat .. ' (' .. languages[lang_iso].name  .. ')|' .. languages[lang_iso2]['key'] .. ']]' .. "\n"
				else
					cat = '[[Κατηγορία:' .. write_cat .. ' ' .. apota_text  .. '|' .. languages[lang_iso]['key'].. ']]' .. "\n"
					.. '[[Κατηγορία:' .. write_cat .. ' (' .. languages[lang_iso2].name  .. ')|' .. languages[lang_iso].key .. ']]' .. "\n"
					.. '[[Κατηγορία:' .. write_cat .. ' (' .. languages[lang_iso].name  .. ')|' .. languages[lang_iso2].key .. ']]' .. "\n"
					.. '[[Κατηγορία:Ορθογραφικά δάνεια' .. ' ' .. apota_text  .. ' (' .. languages[lang_iso].name .. ')| ]]' .. "\n" -- sort top ??? λέξη επώνυμα, ονόματα κλπ
				end	
				
			end -- close cat_parenthesis
			
		end -- close if write_cat
	end -- close write_cat apota Ορθογραφικό δάνειο - ονόματα κλπ


-- APOTA + Φωνητικές + ονόματα/επών/ανθρωπ/τοπωνύμια level_3 ========= parent = Φωνητικές αποδόσεις
--  [[:Κατηγορία:Φωνητικές αποδόσεις - τοπωνύμια από τα ισπανικά (νέα ελληνικά)]]
	if mw.ustring.find(cat_title, 'από') and mw.ustring.find(cat_title, 'Φωνητικές αποδόσεις') and mw.ustring.find(cat_title, '-') then
		lang_iso2 = get_apota(apota_text)
		apota_text = get_apota_text(cat_title)
		apota_label = get_apota_label(cat_title)
		
		write_text = ''
		if mw.ustring.find(cat_title, 'ονόματα') then write_cat = 'Φωνητικές αποδόσεις - ονόματα' end 
		if mw.ustring.find(cat_title, 'επώνυμα') then write_cat = 'Φωνητικές αποδόσεις - επώνυμα' end 
		if mw.ustring.find(cat_title, 'ανθρωπωνύμια') then write_cat = 'Φωνητικές αποδόσεις - ανθρωπωνύμια' end 
		if mw.ustring.find(cat_title, 'τοπωνύμια') then write_cat = 'Φωνητικές αποδόσεις - τοπωνύμια' end 
		
		if write_cat ~= '' and write_cat ~= nil then
-- a mode ???? --------- do I need the keys of level_2 ? -------------
			if cat_parenthesis == '' or cat_parenthesis == nil then
				text = text_wikt .. ' » [[:Κατηγορία:Ετυμολογία|Ετυμολογία]]' 
				.. ' » [[:Κατηγορία:Δανεισμοί|Δανεισμοί]] » [[:Κατηγορία:Φωνητικές αποδόσεις|Φωνητικές αποδόσεις]]  ' .. textit
				-- DO NOT if languages[lang_iso].host_iso == languages[lang_iso2].iso Κατηγορία:Φωνητικές αποδόσεις - τοπωνύμια από τα αγγλικά
				if languages[lang_iso2].name == 'διάφορες γλώσσες' then text = text
				else
				text = text 	
				.. ' « [[:Κατηγορία:Ετυμολογία (' .. languages[lang_iso2].name ..  ')|<i>Ετυμολογία</i>]]'
				.. ' « [[:Κατηγορία:' .. languages[lang_iso2].cat ..  '|<i>' .. mw.getContentLanguage():ucfirst(languages[lang_iso2].name) .. '</i>]]'	
				end
-- $addsublang

				-- cat a
				if languages[lang_iso2].sublang then
					cat = '[[Κατηγορία:' .. apota_label .. ' (' .. languages[lang_iso2].name .. ')|' .. "'" .. ']]' .. "\n"
					.. '[[Κατηγορία:' .. write_cat .. ' ' .. languages[lang_iso2].host_apota .. '|' .. languages[lang_iso2].apota_key .. ']]' .. "\n"
				else
					cat = '[[Κατηγορία:' .. apota_label .. ' (' .. languages[lang_iso2].name  .. ')|' .. "'" .. ']]' .. "\n"
					.. '[[Κατηγορία:Φωνητικές αποδόσεις ' .. apota_text  .. '| ' .. cat_title ..  ']]' .. "\n" -- sort top -- ???? NOT POSSIBLE data.label[write_text]['key']
				end
-- b mode
			else

				text = text_lang ..  ' » [[:Κατηγορία:Ετυμολογία (' ..	lang_name .. ')|Ετυμολογία]]'
				.. ' » [[:Κατηγορία:Δανεισμοί (' ..	lang_name .. ')|Δανεισμοί]]'
				.. ' » [[:Κατηγορία:Φωνητικές αποδόσεις (' ..	lang_name .. ')|Φωνητικές αποδόσεις]] ' .. textit_lang
				if languages[lang_iso].host_iso == languages[lang_iso2].iso
				or languages[lang_iso2].name == 'διάφορες γλώσσες' then
				text = text
				else
				text = text 	
				.. ' « [[:Κατηγορία:Ετυμολογία (' .. languages[lang_iso2].name ..  ')|<i>Ετυμολογία</i>]]'
				.. ' « [[:Κατηγορία:' .. languages[lang_iso2].cat ..  '|<i>' .. mw.getContentLanguage():ucfirst(languages[lang_iso2].name) .. '</i>]]'		
				end
-- $addsublang
				
				-- cat b
				if languages[lang_iso].sublang == true and not languages[lang_iso2].sublang == true then
					cat = '[[Κατηγορία:' .. write_cat .. ' ' .. apota_text  .. '|' .. languages[lang_iso]['key'].. ']]' .. "\n"
					.. '[[Κατηγορία:' .. write_cat .. ' ' .. apota_text  .. ' (' .. languages[lang_iso].host_name  .. ')|' .. languages[lang_iso].host_key.. ']]' .. "\n"
					.. '[[Κατηγορία:' .. write_cat .. ' (' .. languages[lang_iso].name  .. ')|' .. languages[lang_iso2].key .. ']]' .. "\n"	
				elseif languages[lang_iso2].sublang == true and not languages[lang_iso].sublang == true then
					cat = '[[Κατηγορία:' .. write_cat .. ' ' .. apota_text  .. '|' .. languages[lang_iso]['key'].. ']]' .. "\n"
					.. '[[Κατηγορία:' .. write_cat .. ' ' .. languages[lang_iso2].host_apota .. ' (' .. languages[lang_iso].name .. ')|' .. languages[lang_iso2].apota_key .. ']]' .. "\n"
				elseif languages[lang_iso].sublang == true and  languages[lang_iso2].sublang == true then
					cat = '[[Κατηγορία:' .. write_cat .. '|' .. languages[lang_iso]['key'].. ']]' .. "\n"
					.. '[[Κατηγορία:' .. write_cat .. ' ' .. apota_text  .. '|' .. languages[lang_iso]['key'].. ']]' .. "\n"
					.. '[[Κατηγορία:' .. write_cat .. ' ' .. apota_text  .. ' (' .. languages[lang_iso].host_name  .. ')|' .. languages[lang_iso].host_key.. ']]' .. "\n"
					.. '[[Κατηγορία:' .. write_cat .. ' ' .. languages[lang_iso2].host_apota .. ' (' .. languages[lang_iso].name .. ')|' .. languages[lang_iso2].apota_key .. ']]' .. "\n"
					.. '[[Κατηγορία:' .. write_cat .. ' (' .. languages[lang_iso].name  .. ')|' .. languages[lang_iso2]['key'] .. ']]' .. "\n"
				else
					cat = '[[Κατηγορία:' .. write_cat .. ' ' .. apota_text  .. '|' .. languages[lang_iso]['key'].. ']]' .. "\n"
--					.. '[[Κατηγορία:' .. write_cat .. ' (' .. languages[lang_iso2].name  .. ')|' .. languages[lang_iso].key .. ']]' .. "\n"
					.. '[[Κατηγορία:' .. write_cat .. ' (' .. languages[lang_iso].name  .. ')|' .. languages[lang_iso2].key .. ']]' .. "\n"
					.. '[[Κατηγορία:Φωνητικές αποδόσεις' .. ' ' .. apota_text  .. ' (' .. languages[lang_iso].name .. ')| ]]' .. "\n" -- sort top ??? λέξη επώνυμα, ονόματα κλπ
				end	
				
			end -- close cat_parenthesis
			
		end -- close if write_cat
	end -- close write_cat apota Φωνητικές - ονόματα



-- APOTA + Μεταγραμμένοι όροι + ονόματα/επών/ανθρωπ/τοπωνύμια level_3 ========= parent = Μεταγραμμένοι όροι
	if mw.ustring.find(cat_title, 'από') and mw.ustring.find(cat_title, 'Μεταγραμμένοι όροι') and mw.ustring.find(cat_title, '-') then
		lang_iso2 = get_apota(apota_text)
		apota_text = get_apota_text(cat_title)
		apota_label = get_apota_label(cat_title)
		
		write_text = ''
		if mw.ustring.find(cat_title, 'ονόματα') then write_cat = 'Μεταγραμμένοι όροι - ονόματα' end 
		if mw.ustring.find(cat_title, 'επώνυμα') then write_cat = 'Μεταγραμμένοι όροι - επώνυμα' end 
		if mw.ustring.find(cat_title, 'ανθρωπωνύμια') then write_cat = 'Μεταγραμμένοι όροι - ανθρωπωνύμια' end 
		if mw.ustring.find(cat_title, 'τοπωνύμια') then write_cat = 'Μεταγραμμένοι όροι - τοπωνύμια' end 
		
		if write_cat ~= '' and write_cat ~= nil then
-- a mode ???? --------- do I need the keys of level_2 ? -------------
			if cat_parenthesis == '' or cat_parenthesis == nil then
				text = text_wikt .. ' » [[:Κατηγορία:Ετυμολογία|Ετυμολογία]]' 
				.. ' » [[:Κατηγορία:Δανεισμοί|Δανεισμοί]] » [[:Κατηγορία:Μεταγραμμένοι όροι|Μεταγραφές]]  ' .. textit
				-- DO NOT if languages[lang_iso].host_iso == languages[lang_iso2].iso
					-- check this: Κατηγορία:Μεταγραμμένοι όροι - τοπωνύμια από τα αγγλικά
				if languages[lang_iso2].name == 'διάφορες γλώσσες' then text = text
				else
				text = text 		
				.. ' « [[:Κατηγορία:Ετυμολογία (' .. languages[lang_iso2].name ..  ')|<i>Ετυμολογία</i>]]'
				.. ' « [[:Κατηγορία:' .. languages[lang_iso2].cat ..  '|<i>' .. mw.getContentLanguage():ucfirst(languages[lang_iso2].name) .. '</i>]]'	
				end
-- $addsublang
				
				-- cat a
				if languages[lang_iso2].sublang then
					cat = '[[Κατηγορία:' .. apota_label .. ' (' .. languages[lang_iso2].name .. ')|' .. "'" .. ']]' .. "\n"
					.. '[[Κατηγορία:' .. write_cat .. ' ' .. languages[lang_iso2].host_apota .. '|' .. languages[lang_iso2].apota_key .. ']]' .. "\n"
				else
					cat = '[[Κατηγορία:' .. apota_label .. ' (' .. languages[lang_iso2].name  .. ')|' .. "'" .. ']]' .. "\n"
					.. '[[Κατηγορία:Μεταγραμμένοι όροι ' .. apota_text  .. '| ' .. cat_title ..  ']]' .. "\n" -- sort top -- ???? NOT POSSIBLE data.label[write_text]['key']
				end
-- b mode
			else

				text = text_lang ..  ' » [[:Κατηγορία:Ετυμολογία (' ..	lang_name .. ')|Ετυμολογία]]'
				.. ' » [[:Κατηγορία:Δανεισμοί (' ..	lang_name .. ')|Δανεισμοί]]'
				.. ' » [[:Κατηγορία:Μεταγραμμένοι όροι (' ..	lang_name .. ')|Μεταγραφές]] ' .. textit_lang
				if languages[lang_iso].host_iso == languages[lang_iso2].iso
				or languages[lang_iso2].name == 'διάφορες γλώσσες' then text = text
				else
				text = text 		
				.. ' « [[:Κατηγορία:Ετυμολογία (' .. languages[lang_iso2].name ..  ')|<i>Ετυμολογία</i>]]'
				.. ' « [[:Κατηγορία:' .. languages[lang_iso2].cat ..  '|<i>' .. mw.getContentLanguage():ucfirst(languages[lang_iso2].name) .. '</i>]]'		
				end
-- $addsublang
				
				-- cat b
				if languages[lang_iso].sublang == true and not languages[lang_iso2].sublang == true then
					cat = '[[Κατηγορία:' .. write_cat .. ' ' .. apota_text  .. '|' .. languages[lang_iso]['key'].. ']]' .. "\n"
					.. '[[Κατηγορία:' .. write_cat .. ' ' .. apota_text  .. ' (' .. languages[lang_iso].host_name  .. ')|' .. languages[lang_iso].host_key.. ']]' .. "\n"
					.. '[[Κατηγορία:' .. write_cat .. ' (' .. languages[lang_iso].name  .. ')|' .. languages[lang_iso2].key .. ']]' .. "\n"	
				elseif languages[lang_iso2].sublang == true and not languages[lang_iso].sublang == true then
					cat = '[[Κατηγορία:' .. write_cat .. ' ' .. apota_text  .. '|' .. languages[lang_iso]['key'].. ']]' .. "\n"
					.. '[[Κατηγορία:' .. write_cat .. ' ' .. languages[lang_iso2].host_apota .. ' (' .. languages[lang_iso].name .. ')|' .. languages[lang_iso2].apota_key .. ']]' .. "\n"
				elseif languages[lang_iso].sublang == true and  languages[lang_iso2].sublang == true then
					cat = '[[Κατηγορία:' .. write_cat .. '|' .. languages[lang_iso]['key'].. ']]' .. "\n"
					.. '[[Κατηγορία:' .. write_cat .. ' ' .. apota_text  .. '|' .. languages[lang_iso]['key'].. ']]' .. "\n"
					.. '[[Κατηγορία:' .. write_cat .. ' ' .. apota_text  .. ' (' .. languages[lang_iso].host_name  .. ')|' .. languages[lang_iso].host_key.. ']]' .. "\n"
					.. '[[Κατηγορία:' .. write_cat .. ' ' .. languages[lang_iso2].host_apota .. ' (' .. languages[lang_iso].name .. ')|' .. languages[lang_iso2].apota_key .. ']]' .. "\n"
					.. '[[Κατηγορία:' .. write_cat .. ' (' .. languages[lang_iso].name  .. ')|' .. languages[lang_iso2]['key'] .. ']]' .. "\n"
				else
					cat = '[[Κατηγορία:' .. write_cat .. ' ' .. apota_text  .. '|' .. languages[lang_iso]['key'].. ']]' .. "\n"
--					.. '[[Κατηγορία:' .. write_cat .. ' (' .. languages[lang_iso2].name  .. ')|' .. languages[lang_iso].key .. ']]' .. "\n"
					.. '[[Κατηγορία:' .. write_cat .. ' (' .. languages[lang_iso].name  .. ')|' .. languages[lang_iso2].key .. ']]' .. "\n"
					.. '[[Κατηγορία:Μεταγραμμένοι όροι' .. ' ' .. apota_text  .. ' (' .. languages[lang_iso].name .. ')| ]]' .. "\n" -- sort top ??? λέξη επώνυμα, ονόματα κλπ
				end	
				
			end -- close cat_parenthesis
			
		end -- close if write_cat
	end -- close write_cat apota Μεταγραμμένοι όροι - ονόματα



	
-- APOTA + Προέλευση + ονόματα/επών/ανθρωπ/τοπωνύμια level_3 ========= parent = Προέλευση λέξεων
-- test [[:Κατηγορία:Προέλευση λέξεων - ονόματα από τα αρχαία ελληνικά]]
	if mw.ustring.find(cat_title, 'από') and mw.ustring.find(cat_title, 'Προέλευση λέξεων') and mw.ustring.find(cat_title, '-') then
		lang_iso2 = get_apota(apota_text)
		apota_text = get_apota_text(cat_title)
		apota_label = get_apota_label(cat_title)
		
		write_text = ''
		if mw.ustring.find(cat_title, 'ονόματα') then write_cat = 'Προέλευση λέξεων - ονόματα' end 
		if mw.ustring.find(cat_title, 'επώνυμα') then write_cat = 'Προέλευση λέξεων - επώνυμα' end 
		if mw.ustring.find(cat_title, 'ανθρωπωνύμια') then write_cat = 'Προέλευση λέξεων - ανθρωπωνύμια' end 
		if mw.ustring.find(cat_title, 'τοπωνύμια') then write_cat = 'Προέλευση λέξεων - τοπωνύμια' end 
		
		if write_cat ~= '' and write_cat ~= nil then
-- a mode ???? --------- do I need the keys of level_2 ? -------------
			if cat_parenthesis == '' or cat_parenthesis == nil then
				text = text_wikt .. ' » [[:Κατηγορία:Ετυμολογία|Ετυμολογία]]' 
				.. ' » [[:Κατηγορία:Προέλευση λέξεων|Προέλευση λέξεων]]  ' .. textit
				-- DO NOT if languages[lang_iso].host_iso == languages[lang_iso2].iso Κατηγορία:Προέλευση λέξεων - επώνυμα από τα αγγλικά
				if languages[lang_iso2].name == 'διάφορες γλώσσες' then
				text = text
				else
				text = text 
				.. ' « [[:Κατηγορία:Ετυμολογία (' .. languages[lang_iso2].name ..  ')|<i>Ετυμολογία</i>]]'
				.. ' « [[:Κατηγορία:' .. languages[lang_iso2].cat ..  '|<i>' .. mw.getContentLanguage():ucfirst(languages[lang_iso2].name) .. '</i>]]'
				end
-- $addsublang
				
				-- cat a
				-- [[:Κατηγορία:Προέλευση λέξεων - ονόματα από την ελληνιστική κοινή]] -- [[:Κατηγορία:Προέλευση λέξεων - ονόματα από τα αγγλικά]]
				if languages[lang_iso2].sublang then
					cat = '[[Κατηγορία:' .. apota_label .. ' (' .. languages[lang_iso2].name .. ')|' .. "'" .. ']]' .. "\n"
					.. '[[Κατηγορία:' .. write_cat .. ' ' .. languages[lang_iso2].host_apota .. '|' .. languages[lang_iso2].apota_key .. ']]' .. "\n"
				else
					cat = '[[Κατηγορία:' .. apota_label .. ' (' .. languages[lang_iso2].name  .. ')|' .. "'" .. ']]' .. "\n"
					.. '[[Κατηγορία:Προέλευση λέξεων ' .. apota_text  .. '| ' .. cat_title ..  ']]' .. "\n" -- sort top -- ???? NOT POSSIBLE data.label[write_text]['key']
				end
-- b mode
			else

				text = text_lang ..  ' » [[:Κατηγορία:Ετυμολογία (' ..	lang_name .. ')|Ετυμολογία]]'
				.. ' » [[:Κατηγορία:Προέλευση λέξεων (' ..	lang_name .. ')|Προέλευση λέξεων]] ' .. textit_lang -- need extra1 from data.label
				.. ' [[:Κατηγορία:' .. cat_title .. '|«««]]'
				if languages[lang_iso].iso == languages[lang_iso2].iso -- Κατηγορία:Προέλευση λέξεων - επώνυμα από τα νέα ελληνικά (νέα ελληνικά)
				or languages[lang_iso2].name == 'διάφορες γλώσσες'
				then
				text = text
				else text = text
				.. ' « [[:Κατηγορία:Ετυμολογία (' .. languages[lang_iso2].name ..  ')|<i>Ετυμολογία</i>]]'
				.. ' « [[:Κατηγορία:' .. languages[lang_iso2].cat ..  '|<i>' .. mw.getContentLanguage():ucfirst(languages[lang_iso2].name) .. '</i>]]'
				end
-- $addsublang				
				-- cat b
				-- [[:Κατηγορία:Προέλευση λέξεων - ονόματα από τα αρχαία ελληνικά (νεολατινικά)]]
				if languages[lang_iso].sublang == true and not languages[lang_iso2].sublang == true then
					cat = '[[Κατηγορία:' .. write_cat .. ' ' .. apota_text  .. '|' .. languages[lang_iso]['key'].. ']]' .. "\n"
					.. '[[Κατηγορία:' .. write_cat .. ' ' .. apota_text  .. ' (' .. languages[lang_iso].host_name  .. ')|' .. languages[lang_iso].host_key.. ']]' .. "\n"
					.. '[[Κατηγορία:' .. write_cat .. ' (' .. languages[lang_iso].name  .. ')|' .. languages[lang_iso2].key .. ']]' .. "\n"	
				-- [[:Κατηγορία:Προέλευση λέξεων - ονόματα από τα μεσαιωνικά λατινικά (αγγλικά)]]
				elseif languages[lang_iso2].sublang == true and not languages[lang_iso].sublang == true then
					cat = '[[Κατηγορία:' .. write_cat .. ' ' .. apota_text  .. '|' .. languages[lang_iso]['key'].. ']]' .. "\n"
					.. '[[Κατηγορία:' .. write_cat .. ' ' .. languages[lang_iso2].host_apota .. ' (' .. languages[lang_iso].name .. ')|' .. languages[lang_iso2].apota_key .. ']]' .. "\n"
				-- [[:Κατηγορία:Προέλευση λέξεων - ονόματα από τα μεσαιωνικά λατινικά (ελληνιστική κοινή)]]
				elseif languages[lang_iso].sublang == true and  languages[lang_iso2].sublang == true then
					cat = '[[Κατηγορία:' .. write_cat .. '|' .. languages[lang_iso]['key'].. ']]' .. "\n"
					.. '[[Κατηγορία:' .. write_cat .. ' ' .. apota_text  .. '|' .. languages[lang_iso]['key'].. ']]' .. "\n"
					.. '[[Κατηγορία:' .. write_cat .. ' ' .. apota_text  .. ' (' .. languages[lang_iso].host_name  .. ')|' .. languages[lang_iso].host_key.. ']]' .. "\n"
					.. '[[Κατηγορία:' .. write_cat .. ' ' .. languages[lang_iso2].host_apota .. ' (' .. languages[lang_iso].name .. ')|' .. languages[lang_iso2].apota_key .. ']]' .. "\n"
					.. '[[Κατηγορία:' .. write_cat .. ' (' .. languages[lang_iso].name  .. ')|' .. languages[lang_iso2]['key'] .. ']]' .. "\n"
				-- -- [[:Κατηγορία:Προέλευση λέξεων - επώνυμα από τα αρμενικά (νέα ελληνικά)]]
				else
					cat = '[[Κατηγορία:' .. write_cat .. ' ' .. apota_text  .. '|' .. languages[lang_iso]['key'].. ']]' .. "\n"
					.. '[[Κατηγορία:' .. write_cat .. ' (' .. languages[lang_iso2].name  .. ')|' .. languages[lang_iso].key .. ']]' .. "\n"
					.. '[[Κατηγορία:' .. write_cat .. ' (' .. languages[lang_iso].name  .. ')|' .. languages[lang_iso2].key .. ']]' .. "\n"
					.. '[[Κατηγορία:Προέλευση λέξεων' .. ' ' .. apota_text  .. ' (' .. languages[lang_iso].name .. ')| ]]' .. "\n" -- sort top ??? λέξη επώνυμα, ονόματα κλπ
				end	
				-- need extra1 from data.label
		
			end -- close cat_parenthesis
			
		end -- close if write_cat
	end -- close write_cat apota Προέλευση λέξεων - ονόματα



-- APOTA + Κληρονομημένες + ονόματα/επών/ανθρωπ/τοπωνύμια level_3 ========= parent = Κληρονομημένες λέξεις
-- test [[:Κατηγορία:Κληρονομημένες λέξεις - ονόματα από τα αρχαία ελληνικά]]
	if mw.ustring.find(cat_title, 'από') and mw.ustring.find(cat_title, 'Κληρονομημένες λέξεις') and mw.ustring.find(cat_title, '-') then
		lang_iso2 = get_apota(apota_text)
		apota_text = get_apota_text(cat_title)
		apota_label = get_apota_label(cat_title)
		
		write_text = ''
		if mw.ustring.find(cat_title, 'ονόματα') then write_cat = 'Κληρονομημένες λέξεις - ονόματα' end 
		if mw.ustring.find(cat_title, 'επώνυμα') then write_cat = 'Κληρονομημένες λέξεις - επώνυμα' end 
		if mw.ustring.find(cat_title, 'ανθρωπωνύμια') then write_cat = 'Κληρονομημένες λέξεις - ανθρωπωνύμια' end 
		if mw.ustring.find(cat_title, 'τοπωνύμια') then write_cat = 'Κληρονομημένες λέξεις - τοπωνύμια' end 
		
		if write_cat ~= '' and write_cat ~= nil then
-- a mode
			if cat_parenthesis == '' or cat_parenthesis == nil then
				text = text_wikt .. ' » [[:Κατηγορία:Ετυμολογία|Ετυμολογία]]' 
				.. ' » [[:Κατηγορία:Κληρονομημένες λέξεις|Κληρονομημένες λέξεις]]  ' .. textit
		-- this is impossible: 	 	if languages[lang_iso2].name == 'διάφορες γλώσσες' then text = text
				--DO NOT PUT if languages[lang_iso].host_iso == languages[lang_iso2].iso then Κατηγορία:Κληρονομημένες λέξεις - επώνυμα από τα μεσαιωνικά ελληνικά
				.. ' « [[:Κατηγορία:Ετυμολογία (' .. languages[lang_iso2].name ..  ')|<i>Ετυμολογία</i>]]'
				.. ' « [[:Κατηγορία:' .. languages[lang_iso2].cat ..  '|<i>' .. mw.getContentLanguage():ucfirst(languages[lang_iso2].name) .. '</i>]]'

-- $addsublang
				
				-- cat a
				-- [[:Κατηγορία:Κληρονομημένες λέξεις - ονόματα από την ελληνιστική κοινή]] -- [[:Κατηγορία:Κληρονομημένες λέξεις - ονόματα από τα αγγλικά]]
				if languages[lang_iso2].sublang then
					cat = '[[Κατηγορία:' .. apota_label .. ' (' .. languages[lang_iso2].name .. ')|' .. "'" .. ']]' .. "\n"
					.. '[[Κατηγορία:' .. write_cat .. ' ' .. languages[lang_iso2].host_apota .. '|' .. languages[lang_iso2].apota_key .. ']]' .. "\n"
				else
					cat = '[[Κατηγορία:' .. apota_label .. ' (' .. languages[lang_iso2].name  .. ')|' .. "'" .. ']]' .. "\n"
					.. '[[Κατηγορία:Κληρονομημένες λέξεις ' .. apota_text  .. '| ' .. cat_title ..  ']]' .. "\n" -- sort top -- ???? NOT POSSIBLE data.label[write_text]['key']
				end
-- b mode
			else

				text = text_lang ..  ' » [[:Κατηγορία:Ετυμολογία (' ..	lang_name .. ')|Ετυμολογία]]'
				.. ' » [[:Κατηγορία:Κληρονομημένες λέξεις (' ..	lang_name .. ')|Κληρονομημένες λέξεις]] ' .. textit_lang
				if languages[lang_iso].host_iso == languages[lang_iso2].iso then
				text = text
				.. ' « [[:Κατηγορία:Ετυμολογία (' .. languages[lang_iso2].name ..  ')|<i>Ετυμολογία</i>]]'
				.. ' « [[:Κατηγορία:' .. languages[lang_iso2].cat ..  '|<i>' .. mw.getContentLanguage():ucfirst(languages[lang_iso2].name) .. '</i>]]'
				end
-- $addsublang

				-- cat b
				-- [[:Κατηγορία:Κληρονομημένες λέξεις - ονόματα από τα αρχαία ελληνικά (νεολατινικά)]]
				if languages[lang_iso].sublang == true and not languages[lang_iso2].sublang == true then
					cat = '[[Κατηγορία:' .. write_cat .. ' ' .. apota_text  .. '|' .. languages[lang_iso]['key'].. ']]' .. "\n"
					.. '[[Κατηγορία:' .. write_cat .. ' ' .. apota_text  .. ' (' .. languages[lang_iso].host_name  .. ')|' .. languages[lang_iso].host_key.. ']]' .. "\n"
					.. '[[Κατηγορία:' .. write_cat .. ' (' .. languages[lang_iso].name  .. ')|' .. languages[lang_iso2].key .. ']]' .. "\n"	
				-- [[:Κατηγορία:Κληρονομημένες λέξεις - ονόματα από τα μεσαιωνικά λατινικά (αγγλικά)]]
				elseif languages[lang_iso2].sublang == true and not languages[lang_iso].sublang == true then
					cat = '[[Κατηγορία:' .. write_cat .. ' ' .. apota_text  .. '|' .. languages[lang_iso]['key'].. ']]' .. "\n"
					.. '[[Κατηγορία:' .. write_cat .. ' ' .. languages[lang_iso2].host_apota .. ' (' .. languages[lang_iso].name .. ')|' .. languages[lang_iso2].apota_key .. ']]' .. "\n"
				-- [[:Κατηγορία:Κληρονομημένες λέξεις - ονόματα από τα μεσαιωνικά λατινικά (ελληνιστική κοινή)]]
				elseif languages[lang_iso].sublang == true and  languages[lang_iso2].sublang == true then
					cat = '[[Κατηγορία:' .. write_cat .. '|' .. languages[lang_iso]['key'].. ']]' .. "\n"
					.. '[[Κατηγορία:' .. write_cat .. ' ' .. apota_text  .. '|' .. languages[lang_iso]['key'].. ']]' .. "\n"
					.. '[[Κατηγορία:' .. write_cat .. ' ' .. apota_text  .. ' (' .. languages[lang_iso].host_name  .. ')|' .. languages[lang_iso].host_key.. ']]' .. "\n"
					.. '[[Κατηγορία:' .. write_cat .. ' ' .. languages[lang_iso2].host_apota .. ' (' .. languages[lang_iso].name .. ')|' .. languages[lang_iso2].apota_key .. ']]' .. "\n"
					.. '[[Κατηγορία:' .. write_cat .. ' (' .. languages[lang_iso].name  .. ')|' .. languages[lang_iso2]['key'] .. ']]' .. "\n"
				-- [[:Κατηγορία:Κληρονομημένες λέξεις - ονόματα από τα αρχαία ελληνικά (νέα ελληνικά)]]
				else
					cat = '[[Κατηγορία:' .. write_cat .. ' ' .. apota_text  .. '|' .. languages[lang_iso]['key'].. ']]' .. "\n"
					.. '[[Κατηγορία:' .. write_cat .. ' (' .. languages[lang_iso2].name  .. ')|' .. languages[lang_iso].key .. ']]' .. "\n"
					.. '[[Κατηγορία:' .. write_cat .. ' (' .. languages[lang_iso].name  .. ')|' .. languages[lang_iso2].key .. ']]' .. "\n"
					.. '[[Κατηγορία:Κληρονομημένες λέξεις' .. ' ' .. apota_text  .. ' (' .. languages[lang_iso].name .. ')| ]]' .. "\n" -- sort top ??? λέξη επώνυμα, ονόματα κλπ
				end	
				
			end -- close cat_parenthesis
			
		end -- close if write_cat
	end -- close write_cat apota Κληρονομημένες λέξεις - ονόματα

end -- close if από	


--------------------------------------------------------------------------
--                     Ετυμολογία Etymology                             --
--           FUNCTIONS apotin :  langapo root *xx (language)            --
--------------------------------------------------------------------------
-- e.g. [[:Κατηγορία:Προέλευση λέξεων από την πρωτοϊνδοευρωπαϊκή ρίζα *gʷelH- (αρχαία ελληνικά)]]
-- ============ from root: match the part of the cat_title with Module:languages param. frm
	local autosort = ''
	local sort = args[1] or args['sort'] or '' 

function get_langapotin_text(langapotin_text)
-- languages apo = feminine article+accusative e.g. την αραβική, την πρωτοελληνική
-- take off Προέλευση από & take off everything after ρίζα *xxxx
-- ++ -- NOT Λέξεις από: βλ. [[Πρότυπο:από]]
	if mw.ustring.find(cat_title, 'από') and not mw.ustring.find(cat_title, 'από το')
	and mw.ustring.find(cat_title, 'ρίζα')
	and not mw.ustring.find(cat_title, 'αναδρομικό')
--	other από
	and not mw.ustring.find(cat_title, 'από ανθρωπωνύμια')
	and not mw.ustring.find(cat_title, 'από αξιώματα')
	and not mw.ustring.find(cat_title, 'από δημοτικά τραγούδια') 
	and not mw.ustring.find(cat_title, 'από διαφημίσεις') 
	and not mw.ustring.find(cat_title, 'από εθνικά ονόματα') 
	and not mw.ustring.find(cat_title, 'από επαγγέλματα') 
	and not mw.ustring.find(cat_title, 'από επιγραφές') 
	and not mw.ustring.find(cat_title, 'από επωνυμίες') 
	and not mw.ustring.find(cat_title, 'από ιατρικά')
	and not mw.ustring.find(cat_title, 'από ιδιότητες')
	and not mw.ustring.find(cat_title, 'από καλλιτεχνικά έργα') 
	and not mw.ustring.find(cat_title, 'από λεξικά') 
	and not mw.ustring.find(cat_title, 'από νόμους')
	and not mw.ustring.find(cat_title, 'από ονόματα')
	and not mw.ustring.find(cat_title, 'από παπύρους') 
	and not mw.ustring.find(cat_title, 'από παρωνύμια') 
	and not mw.ustring.find(cat_title, 'από συναρπαγή')
	and not mw.ustring.find(cat_title, 'από τα έργα')
	and not mw.ustring.find(cat_title, 'από τις τέχνες') 
	and not mw.ustring.find(cat_title, 'από τον') 
	and not mw.ustring.find(cat_title, 'από τοπωνύμια')
-- words
	and not mw.ustring.find(cat_title, 'απόλυτα')
	and not mw.ustring.find(cat_title, 'απόστολος')
	and not mw.ustring.find(cat_title, 'Λέξεις από') 
	and not mw.ustring.find(cat_title, 'πρόθημα από')
	and not mw.ustring.find(cat_title, 'ως προς')  
	then 
 
	langapotin_text = mw.ustring.sub(mw.ustring.match(cat_title, "από (.*) ρίζα"), 1, -1) -- gives e.g. την πρωτοϊνδοευρωπαϊκή
	end
return langapotin_text
end

function get_apotin(iso2)
	lang_iso2 = require("Module:lang").langapo_to_langiso(get_langapotin_text(langapotin_text))
return lang_iso2
end

function get_langapotin_label(langapotin_label)
	length = mw.ustring.len(get_langapotin_text(langapotin_text))
	langapotin_label = mw.ustring.sub(cat_title, 1, -length-1) -- length gives me: Label α.  So, i substract one more.
return langapotin_label
end

function get_apota_param(apota_param)
	apota_param = require("Module:lang").langiso_to_langapota(get_apotin(iso2))
return apota_param
end

-- -------------------- APPLICATIONS langapotin root -------------------------
if mw.ustring.find(cat_title, 'Προέλευση λέξεων από') and mw.ustring.find(cat_title, 'ρίζα')
	then
		lang_iso2 = get_apotin(langapotin_text)
		langapotin_label = get_langapotin_label(cat_title)
		lang_from_root = mw.ustring.sub(mw.ustring.match(cat_title, "από (.*)"), 1, -1) -- gives e.g. ...κή ρίζα *χχχχ
		root_word = mw.ustring.sub(mw.ustring.match(cat_title, "ρίζα (.*)"), 1, -1)
			-- FOR TEXT for sense like [[:Κατηγορία:Προέλευση λέξεων από την πρωτοϊνδοευρωπαϊκή ρίζα *sekʷ-, λέω]]
			-- like [[:Κατηγορία:Προέλευση λέξεων από την πρωτοϊνδοευρωπαϊκή ρίζα *sekʷ-, λέω (αρχαία ελληνικά)]]
			-- control (without lemma=) [[:Κατηγορία:Προέλευση λέξεων από την πρωτοϊνδοευρωπαϊκή ρίζα *gʷelH- (αρχαία ελληνικά)]]
			local other_lemma = args['lemma'] or args['λήμμα'] or '' -- link to different lemma (similar to args at affixes)
			if (args['lemma'] ~= '' and args['lemma'] ~= nil) or (args['λήμμα'] ~= '' and args['λήμμα'] ~= nil)
			then
				root_word_text = other_lemma
			else
				root_word_text = root_word
			end
		apota_text = get_apota_param(apota_param)
		if mw.ustring.find(cat_title, 'Προέλευση λέξεων από') and mw.ustring.find(cat_title, 'ρίζα') then write_cat = 'Προέλευση λέξεων' end
		

-- apota a mode
			if cat_parenthesis == '' or cat_parenthesis == nil then

				text = text_wikt .. ' » [[:Κατηγορία:Ετυμολογία|Ετυμολογία]]'
				.. ' » [[:Κατηγορία:' .. write_cat .. '|' .. write_cat .. ']]'
				.. ' » [[:Κατηγορία:' .. write_cat .. ' ' .. languages[lang_iso2].apota .. '|'  .. languages[lang_iso2].apota .. ']]'
				.. ' » [[:Κατηγορία:' .. page_text .. '| ρίζα ]] <i>[[' .. root_word_text .. ']]</i>'
				.. ' « [[:Κατηγορία:Ετυμολογία (' .. languages[lang_iso2].name ..  ')|<i>Ετυμολογία</i>]]'
				.. ' « [[:Κατηγορία:' .. languages[lang_iso2].cat ..  '|<i>' .. mw.getContentLanguage():ucfirst(languages[lang_iso2].name) .. '</i>]]'

				-- MAKE root_word italics at title e.g. [[:Κατηγορία:Προέλευση λέξεων από την πρωτοϊνδοευρωπαϊκή ρίζα *dewk-]]
				-- but not [[:Κατηγορία:Προέλευση λέξεων από την αραβική ρίζα ط م ر]]
				if mw.ustring.find(cat_title, 'πρωτοϊνδοευρωπαϊκή') -- $addmore πρωτο... languages, make a key for them at  [[Module:Languages]]
				then
				text_plus = "\n" .. frame:expandTemplate{ title = 'title', args = {'root'} } .. "\n"
				end
				
				
				-- cat a
				if languages[lang_iso2].sublang then
					if sort == '' or sort == nil then
						if (args['lemma'] ~= '' and args['lemma'] ~= nil) or (args['λήμμα'] ~= '' and args['λήμμα'] ~= nil)
						then	
						cat = cat .. '[[Κατηγορία:' .. write_cat .. ' ' .. apota_text ..  ' ρίζα ' .. other_lemma .. '| ]]' .. "\n" -- sort top
						else		
							if root_word:sub(1, 1) == '*' then
						cat = '[[Κατηγορία:' .. write_cat .. ' ' .. apota_text .. ' - ρίζες|' .. root_word:sub(2, -1) .. ']]' .. "\n" -- sort without asterisc: start from 2nd character 
							else
						cat = '[[Κατηγορία:' .. write_cat .. ' ' .. apota_text .. ' - ρίζες|' .. root_word .. ']]' .. "\n"
							end
						end
					else -- with sort=
						if (args['lemma'] ~= '' and args['lemma'] ~= nil) or (args['λήμμα'] ~= '' and args['λήμμα'] ~= nil)
						then	
						cat = cat .. '[[Κατηγορία:' .. write_cat .. ' ' .. apota_text ..  ' ρίζα ' .. other_lemma .. '| ]]' .. "\n" -- sort top
						else			
							if root_word:sub(1, 1) == '*' then
						cat = '[[Κατηγορία:' .. write_cat .. ' ' .. apota_text .. ' - ρίζες|' .. sort .. ']]' .. "\n" -- sort without asterisc: start from 2nd character 
							else
						cat = '[[Κατηγορία:' .. write_cat .. ' ' .. apota_text .. ' - ρίζες|' .. sort .. ']]' .. "\n"
							end
						end
					end -- close sort
					cat = cat .. '[[Κατηγορία:' .. write_cat .. ' ' .. apota_text .. ' ' .. languages[lang_iso2].host_apota .. '|' .. languages[lang_iso2].apota_key .. ']]' .. "\n"
				else -- no sublang
					if sort == '' or sort == nil then --  [[:Κατηγορία:Προέλευση λέξεων από την πρωτοϊνδοευρωπαϊκή ρίζα *(s)teyg-]]
						-- lemma=*sekʷ- for sense [[:Κατηγορία:Προέλευση λέξεων από την πρωτοϊνδοευρωπαϊκή ρίζα *sekʷ-, λέω]]
						if (args['lemma'] ~= '' and args['lemma'] ~= nil) or (args['λήμμα'] ~= '' and args['λήμμα'] ~= nil)
						then	
						cat = cat .. '[[Κατηγορία:' .. write_cat .. ' ' .. apota_text ..  ' ρίζα ' .. other_lemma .. '| ]]' .. "\n" -- sort top
						else
							if root_word:sub(1, 1) == '*' then
						cat = '[[Κατηγορία:' .. write_cat .. ' ' .. apota_text .. ' - ρίζες|' .. root_word:sub(2, -1) .. ']]' .. "\n" -- sort without asterisc: start from 2nd character 
							else
						cat = '[[Κατηγορία:' .. write_cat .. ' ' .. apota_text .. ' - ρίζες|' .. root_word .. ']]' .. "\n"
							end
						end
					else -- with sort=
						if (args['lemma'] ~= '' and args['lemma'] ~= nil) or (args['λήμμα'] ~= '' and args['λήμμα'] ~= nil)
						then	
						cat = cat .. '[[Κατηγορία:' .. write_cat .. ' ' .. apota_text ..  ' ρίζα ' .. other_lemma .. '|' .. sort .. ']]' .. "\n"
						else		
							if root_word:sub(1, 1) == '*' then
						cat = '[[Κατηγορία:' .. write_cat .. ' ' .. apota_text .. ' - ρίζες|' .. sort .. ']]' .. "\n" -- sort without asterisc: start from 2nd character 
							else
						cat = '[[Κατηγορία:' .. write_cat .. ' ' .. apota_text .. ' - ρίζες|' .. sort .. ']]' .. "\n"
							end
						end
					end -- close sort
				end -- close sublang
				
			else
-- apota b mode  -- [[:Κατηγορία:Προέλευση λέξεων από την πρωτοϊνδοευρωπαϊκή ρίζα *gʷelH- (αρχαία ελληνικά)]]
				-- [[:Κατηγορία:Προέλευση λέξεων από την αραβική ρίζα خ م ر (νέα ελληνικά)]]
				text = text_lang ..  ' » [[:Κατηγορία:Ετυμολογία (' ..	lang_name .. ')|Ετυμολογία]]' 
				.. ' » [[:Κατηγορία:' .. write_cat .. ' (' .. lang_name .. ')|' .. write_cat .. ']]'
				.. ' » [[:Κατηγορία:' .. write_cat .. ' ' .. languages[lang_iso2].apota .. ' (' .. lang_name .. ')|' .. languages[lang_iso2].apota .. ']]'
				.. ' » [[:Κατηγορία:' .. page_text .. '| ρίζα ]] <i>[[' .. root_word_text .. ']]</i>'
				.. ' [[:Κατηγορία:' .. cat_title .. '|«««]]'
				if languages[lang_iso].iso == languages[lang_iso2].iso then -- Κατηγορία:Προέλευση λέξεων από την πρωτοϊνδοευρωπαϊκή ρίζα *deḱ- (πρωτοϊνδοευρωπαϊκή)
					text = text
				else text = text
				.. ' « [[:Κατηγορία:Ετυμολογία (' .. languages[lang_iso2].name ..  ')|<i>Ετυμολογία</i>]]'
				.. ' « [[:Κατηγορία:' .. languages[lang_iso2].cat ..  '|<i>' .. mw.getContentLanguage():ucfirst(languages[lang_iso2].name) .. '</i>]]'
				end

				-- MAKE root_word italices at title e.g. [[:Κατηγορία:Προέλευση λέξεων από την πρωτοϊνδοευρωπαϊκή ρίζα *dewk- (αρχαία ελληνικά)]]
				-- but not [[:Κατηγορία:Προέλευση λέξεων από την αραβική ρίζα ط م ر (αραβικά)]]
				if mw.ustring.find(cat_title, 'πρωτοϊνδοευρωπαϊκή')
				then
				text_plus = "\n" .. frame:expandTemplate{ title = 'title', args = {'root'} } .. "\n"
				end		
				
-- ## need sort here ## need, sense lemma=
				-- cat b ##### sublangs not checked
				if languages[lang_iso].sublang == true and not languages[lang_iso2].sublang == true then
					cat = '[[Κατηγορία:' .. cat_title .. ' (' .. languages[lang_iso].host_name  .. ')|' .. languages[lang_iso].host_key.. ']]' .. "\n"
					.. '[[Κατηγορία:' .. write_cat .. ' ' .. apota_text .. ' - ρίζες (' .. languages[lang_iso].name  .. ')|' .. root_word .. ']]' .. "\n"
				elseif languages[lang_iso2].sublang == true and not languages[lang_iso].sublang == true then
					cat = '[[Κατηγορία:' .. cat_title  .. '|' .. languages[lang_iso]['key'].. ']]' .. "\n"
					.. '[[Κατηγορία:' .. write_cat .. ' ' .. apota_text .. ' - ρίζες ' .. languages[lang_iso2].host_apota .. ' (' .. languages[lang_iso].name .. ')|' .. languages[lang_iso2].apota_key .. ']]' .. "\n"
					.. '[[Κατηγορία:' .. write_cat .. ' ' .. apota_text .. ' - ρίζες (' .. languages[lang_iso2].name  .. ')|' .. root_word .. ']]' .. "\n"	
				elseif languages[lang_iso].sublang == true and languages[lang_iso2].sublang == true then
					cat = '[[Κατηγορία:' .. cat_title  .. '|' .. languages[lang_iso]['key'].. ']]' .. "\n"
					.. '[[Κατηγορία:' .. write_cat .. ' ' .. apota_text  .. ' - ρίζες (' .. languages[lang_iso].host_name  .. ')|' .. languages[lang_iso].host_key .. ']]' .. "\n"
					.. '[[Κατηγορία:' .. write_cat .. ' ' .. apota_text  .. ' - ρίζες ' .. languages[lang_iso2].host_apota .. ' (' .. languages[lang_iso].name .. ')|' .. languages[lang_iso2].apota_key .. ']]' .. "\n"
					.. '[[Κατηγορία:' .. write_cat .. ' ' .. apota_text  .. ' - ρίζες (' .. languages[lang_iso].name  .. ')|' .. root_word .. ']]' .. "\n"
				else
					-- [[:Κατηγορία:Προέλευση λέξεων από την πρωτοϊνδοευρωπαϊκή ρίζα *(s)teyg- (αρχαία ελληνικά)]]
					if sort == '' or sort == nil then
						-- lemma=*sekʷ- for sense [[:Κατηγορία:Προέλευση λέξεων από την πρωτοϊνδοευρωπαϊκή ρίζα *sekʷ-, λέω (αρχαία ελληνικά)]]
						if (args['lemma'] ~= '' and args['lemma'] ~= nil) or (args['λήμμα'] ~= '' and args['λήμμα'] ~= nil)
						then	
						cat = cat .. '[[Κατηγορία:' .. write_cat .. ' ' .. apota_text ..  ' ρίζα ' .. other_lemma .. ' (' .. languages[lang_iso].name  .. ')| ]]' .. "\n" -- sort top
						.. '[[Κατηγορία:' .. write_cat .. ' ' .. apota_text ..  ' ρίζα ' .. root_word .. '|' .. languages[lang_iso].key .. ']]' .. "\n"
						else
						cat = '[[Κατηγορία:' .. cat_title  .. '|' .. languages[lang_iso]['key'].. ']]' .. "\n"
							if root_word:sub(1, 1) == '*' then
						cat = cat .. '[[Κατηγορία:' .. write_cat .. ' ' .. apota_text .. ' - ρίζες (' .. languages[lang_iso].name  .. ')|' .. root_word:sub(2, -1) .. ']]' .. "\n" -- sort without asterisc: start from 2nd character 
							else
						cat = cat .. '[[Κατηγορία:' .. write_cat .. ' ' .. apota_text .. ' - ρίζες (' .. languages[lang_iso].name  .. ')|' .. root_word .. ']]'
							end
						end
						
					else -- with sort
						if (args['lemma'] ~= '' and args['lemma'] ~= nil) or (args['λήμμα'] ~= '' and args['λήμμα'] ~= nil)
						then	
						cat = cat .. '[[Κατηγορία:' .. write_cat .. ' ' .. apota_text ..  ' ρίζα ' .. other_lemma .. ' (' .. languages[lang_iso].name  .. ')| ]]' .. "\n" -- sort top
						.. '[[Κατηγορία:' .. write_cat .. ' ' .. apota_text ..  ' ρίζα ' .. root_word .. '|' .. languages[lang_iso].key .. ']]' .. "\n"
						else
						cat = '[[Κατηγορία:' .. cat_title  .. '|' .. languages[lang_iso]['key'].. ']]' .. "\n"
							if root_word:sub(1, 1) == '*' then
						cat = cat .. '[[Κατηγορία:' .. write_cat .. ' ' .. apota_text .. ' - ρίζες (' .. languages[lang_iso].name  .. ')|' .. sort .. ']]' .. "\n" -- sort without asterisc: start from 2nd character 
							else
						cat = cat .. '[[Κατηγορία:' .. write_cat .. ' ' .. apota_text .. ' - ρίζες (' .. languages[lang_iso].name  .. ')|' .. sort .. ']]'
							end
						end
					end -- close sort
				end
			end -- close parenthesis

end -- close if mw.ustring.find(cat_title, 'Προέλευση λέξεων από') and mw.ustring.find(cat_title, 'ρίζα')



--------------------------------------------------------------------------
--                     Ετυμολογία Etymology                             --
--                         apota +  - ρίζες                               --
--------------------------------------------------------------------------
-- e.g. [[:Κατηγορία:Προέλευση λέξεων από τα αραβικά - ρίζες]]
-- ============ match languages apota
-- ++ -- NOT Λέξεις από: βλ. [[Πρότυπο:από]]
function get_apota_roots_text(apota_roots_text)
	if mw.ustring.find(cat_title, 'από') and not mw.ustring.find(cat_title, 'από το')
	and mw.ustring.find(cat_title, 'ρίζες') and not mw.ustring.find(cat_title, 'ανά γλώσσα')
	and not mw.ustring.find(cat_title, 'αναδρομικό')
--	other από
	and not mw.ustring.find(cat_title, 'από ανθρωπωνύμια')
	and not mw.ustring.find(cat_title, 'από αξιώματα')
	and not mw.ustring.find(cat_title, 'από δημοτικά τραγούδια') 
	and not mw.ustring.find(cat_title, 'από διαφημίσεις') 
	and not mw.ustring.find(cat_title, 'από εθνικά ονόματα') 
	and not mw.ustring.find(cat_title, 'από επαγγέλματα') 
	and not mw.ustring.find(cat_title, 'από επιγραφές') 
	and not mw.ustring.find(cat_title, 'από επωνυμίες') 
	and not mw.ustring.find(cat_title, 'από ιατρικά')
	and not mw.ustring.find(cat_title, 'από ιδιότητες')
	and not mw.ustring.find(cat_title, 'από καλλιτεχνικά έργα') 
	and not mw.ustring.find(cat_title, 'από λεξικά') 
	and not mw.ustring.find(cat_title, 'από νόμους')
	and not mw.ustring.find(cat_title, 'από ονόματα')
	and not mw.ustring.find(cat_title, 'από παπύρους') 
	and not mw.ustring.find(cat_title, 'από παρωνύμια') 
	and not mw.ustring.find(cat_title, 'από συναρπαγή')
	and not mw.ustring.find(cat_title, 'από τα έργα')
	and not mw.ustring.find(cat_title, 'από τις τέχνες') 
	and not mw.ustring.find(cat_title, 'από τον') 
	and not mw.ustring.find(cat_title, 'από τοπωνύμια')
-- words
	and not mw.ustring.find(cat_title, 'απόλυτα')
	and not mw.ustring.find(cat_title, 'απόστολος')
	and not mw.ustring.find(cat_title, 'Λέξεις από') 
	and not mw.ustring.find(cat_title, 'πρόθημα από')
	and not mw.ustring.find(cat_title, 'ως προς')  
	then
		-- PROBLEM βλέπει και το: - ρίζες ανά γλώσσα Άρα, το αλλάζω σε:  Προέλευσης.... , ρίζες ανά γλώσσα
	apota_roots_text = mw.ustring.sub(mw.ustring.match(cat_title, "Προέλευση λέξεων (.*) %- ρίζες"), 1, -1) -- gives e.g. από τα αραβικά
	end
return apota_roots_text
end

function get_apota(iso)
	lang_iso = require("Module:lang").langapota_to_langiso(get_apota_roots_text(apota_roots_text))
return lang_iso
end




-- -------------------- APPLICATION Προέλευση λέξεων .... - ρίζες -------------------------
if mw.ustring.find(cat_title, 'Προέλευση λέξεων από') and mw.ustring.find(cat_title, 'ρίζες') and not mw.ustring.find(cat_title, 'ανά γλώσσα')
	then 
		lang_iso = get_apota(apota_roots_text)
		lang_iso2 = require("Module:lang").langname_to_langiso(lang_name)
		apota_text = get_apota_roots_text(apota_roots_text)
		write_cat = 'Προέλευση λέξεων'
		

-- apota a mode -- e.g. [[:Κατηγορία:Προέλευση λέξεων από τα αραβικά - ρίζες]]
			if cat_parenthesis == '' or cat_parenthesis == nil then
				text = text_wikt .. ' » [[:Κατηγορία:Ετυμολογία|Ετυμολογία]]'
				.. ' » [[:Κατηγορία:' .. write_cat .. '|' .. write_cat .. ']]'
				.. ' » [[:Κατηγορία:' .. write_cat .. ' ' .. apota_text .. '|' .. apota_text .. ']]'
				.. ' » [[:Κατηγορία:' .. page_text .. '|ρίζες]]'
				.. ' » [[:Κατηγορία:' .. write_cat .. ' ' .. apota_text .. ', ρίζες ανά γλώσσα|ανά γλώσσα]]'	
				.. ' « [[:Κατηγορία:Ετυμολογία (' .. languages[lang_iso].name ..  ')|<i>Ετυμολογία</i>]]'
				.. ' « [[:Κατηγορία:' .. languages[lang_iso].cat ..  '|<i>' .. mw.getContentLanguage():ucfirst(languages[lang_iso].name) .. '</i>]]'
				
				-- cat a
				if languages[lang_iso].sublang then
					cat = '[[Κατηγορία:' .. write_cat .. ' ' .. apota_text .. '|' .. "'" .. ']]' .. "\n"
					.. '[[Κατηγορία:' .. write_cat .. ' ' .. languages[lang_iso].host_apota .. ' - ρίζες|' .. languages[lang_iso].apota_key .. ']]' .. "\n"
				else
					cat = '[[Κατηγορία:' .. write_cat .. ' ' .. apota_text .. '|' .. "'" .. ']]' .. "\n"
				end

			else
-- apota b mode  -- e.g. [[:Κατηγορία:Προέλευση λέξεων από τα αραβικά - ρίζες (νέα ελληνικά)]]
				text = text_lang ..  ' » [[:Κατηγορία:Ετυμολογία (' ..	lang_name .. ')|Ετυμολογία]]' 
				.. ' » [[:Κατηγορία:' .. write_cat .. ' (' .. lang_name .. ')|' .. write_cat .. ']]'
				.. ' » [[:Κατηγορία:' .. write_cat .. ' ' .. languages[lang_iso].apota .. ' (' .. lang_name .. ')|' .. languages[lang_iso].apota .. ']]'
				.. ' » [[:Κατηγορία:' .. page_text .. '|ρίζες]]'
				.. ' » [[:Κατηγορία:' .. write_cat .. ' ' .. apota_text .. ', ρίζες ανά γλώσσα|ανά γλώσσα]]'
				.. ' [[:Κατηγορία:' .. cat_title .. '|«««]]'
				.. ' « [[:Κατηγορία:Ετυμολογία (' .. languages[lang_iso].name ..  ')|<i>Ετυμολογία</i>]]'
				.. ' « [[:Κατηγορία:' .. languages[lang_iso].cat ..  '|<i>' .. mw.getContentLanguage():ucfirst(languages[lang_iso].name) .. '</i>]]'

				-- cat b -- PROBLEM με την παύλα της Κατ. Προέλευση.... - ρίζες ανά γλώσσα Το κάνω κόμμα.
				if languages[lang_iso].sublang == true and not languages[lang_iso2].sublang == true then
					cat = '[[Κατηγορία:' .. cat_title .. '|' .. languages[lang_iso2]['key'].. ']]' .. "\n"
					.. '[[Κατηγορία:' .. write_cat .. ' ' .. apota_text .. ' (' .. languages[lang_iso2]['name'] .. ')|' .. languages[lang_iso2].key .. ']]' .. "\n"				
					.. '[[Κατηγορία:' .. write_cat .. ' ' .. languages[lang_iso].host_name .. ' - ρίζες|' .. languages[lang_iso2].key .. ']]' .. "\n"
				elseif languages[lang_iso2].sublang == true and not languages[lang_iso].sublang == true then
					cat = '[[Κατηγορία:' .. cat_title  .. '|' .. languages[lang_iso2]['key'].. ']]' .. "\n"
					.. '[[Κατηγορία:' .. write_cat .. ' ' .. apota_text .. ' (' .. languages[lang_iso2].name  .. ')|' .. languages[lang_iso2]['key'] .. ']]' .. "\n"		
					.. '[[Κατηγορία:' .. write_cat .. ' ' .. apota_text .. ' - ρίζες (' .. languages[lang_iso2].host_name .. ')|' .. languages[lang_iso2].apota_key .. ']]' .. "\n"
				elseif languages[lang_iso].sublang == true and languages[lang_iso2].sublang == true then
					cat = '[[Κατηγορία:' .. cat_title  .. '|' .. languages[lang_iso2]['key'].. ']]' .. "\n"
					.. '[[Κατηγορία:' .. write_cat .. ' ' .. apota_text  .. ' (' .. languages[lang_iso2].name  .. ')|' .. languages[lang_iso2]['key'] .. ']]' .. "\n"
					.. '[[Κατηγορία:' .. write_cat .. ' ' .. languages[lang_iso].host_apota  .. ' - ρίζες (' .. languages[lang_iso2].name .. ')|' .. languages[lang_iso2].key .. ']]' .. "\n"		
					.. '[[Κατηγορία:' .. write_cat .. ' ' .. apota_text  .. ' - ρίζες (' .. languages[lang_iso2].host_name  .. ')|' .. languages[lang_iso].host_key.. ']]' .. "\n"
				else
					cat = '[[Κατηγορία:' .. write_cat .. ' ' .. apota_text .. ', ρίζες ανά γλώσσα|' .. languages[lang_iso2]['key'].. ']]' .. "\n"
					.. '[[Κατηγορία:' .. write_cat .. ' ' .. apota_text .. ' (' .. languages[lang_iso2].name  .. ')| ]]' .. "\n" -- sort top
				end
			end -- close parenthesis

end -- close if mw.ustring.find(cat_title, 'Προέλευση λέξεων από') and mw.ustring.find(cat_title, 'ρίζες')




--------------------------------------------------------------------------
--                     Ετυμολογία Etymology                             --
--            apota + by language , ρίζες ανά γλώσσα                    --
--------------------------------------------------------------------------
--  - ρίζες ανά γλώσσα με παύλα δημιουργουσε πρόβλημα σύγκρουσης με το -ρίζες
-- e.g. [[:Κατηγορία:Προέλευση λέξεων από τα αραβικά, ρίζες ανά γλώσσα]] -- check [[:Κατηγορία:Προέλευση λέξεων από την πρωτοϊνδοευρωπαϊκή, ρίζες ανά γλώσσα]]
-- ============ match languages apota
-- ++ -- NOT Λέξεις από: βλ. [[Πρότυπο:από]]
function get_apota_roots_bylang_text(apota_roots_bylang_text)
	if mw.ustring.find(cat_title, 'από') and not mw.ustring.find(cat_title, 'από το')
	and mw.ustring.find(cat_title, 'ρίζες') and  mw.ustring.find(cat_title, 'ανά γλώσσα')
--	other από
	and not mw.ustring.find(cat_title, 'από ανθρωπωνύμια')
	and not mw.ustring.find(cat_title, 'από αξιώματα')
	and not mw.ustring.find(cat_title, 'από δημοτικά τραγούδια') 
	and not mw.ustring.find(cat_title, 'από διαφημίσεις') 
	and not mw.ustring.find(cat_title, 'από εθνικά ονόματα') 
	and not mw.ustring.find(cat_title, 'από επαγγέλματα') 
	and not mw.ustring.find(cat_title, 'από επιγραφές') 
	and not mw.ustring.find(cat_title, 'από επωνυμίες') 
	and not mw.ustring.find(cat_title, 'από ιατρικά')
	and not mw.ustring.find(cat_title, 'από ιδιότητες')
	and not mw.ustring.find(cat_title, 'από καλλιτεχνικά έργα') 
	and not mw.ustring.find(cat_title, 'από λεξικά') 
	and not mw.ustring.find(cat_title, 'από νόμους')
	and not mw.ustring.find(cat_title, 'από ονόματα')
	and not mw.ustring.find(cat_title, 'από παπύρους') 
	and not mw.ustring.find(cat_title, 'από παρωνύμια') 
	and not mw.ustring.find(cat_title, 'από συναρπαγή')
	and not mw.ustring.find(cat_title, 'από τα έργα')
	and not mw.ustring.find(cat_title, 'από τις τέχνες') 
	and not mw.ustring.find(cat_title, 'από τον') 
	and not mw.ustring.find(cat_title, 'από τοπωνύμια')
-- words
	and not mw.ustring.find(cat_title, 'απόλυτα')
	and not mw.ustring.find(cat_title, 'απόστολος')
	and not mw.ustring.find(cat_title, 'Λέξεις από') 
	and not mw.ustring.find(cat_title, 'πρόθημα από')
	and not mw.ustring.find(cat_title, 'ως προς')  
	then
		-- PROBLEM could not use hyphen. - ρίζες
	apota_roots_bylang_text = mw.ustring.sub(mw.ustring.match(cat_title, "Προέλευση λέξεων (.*), ρίζες ανά γλώσσα"), 1, -1) -- gives e.g. από τα αραβικά
	end
return apota_roots_bylang_text
end

function get_apota(iso)
	lang_iso = require("Module:lang").langapota_to_langiso(get_apota_roots_bylang_text(apota_roots_bylang_text))
return lang_iso
end


-- -------------------- APPLICATION Προέλευση λέξεων .... , ρίζες ανά γλώσσα -------------------------
if mw.ustring.find(cat_title, 'Προέλευση λέξεων από') and mw.ustring.find(cat_title, 'ρίζες') and mw.ustring.find(cat_title, 'ανά γλώσσα')
	then 
		lang_iso = get_apota(apota_roots_bylang_text)
		apota_text = get_apota_roots_bylang_text(apota_roots_bylang_text)
		write_cat = 'Προέλευση λέξεων'
		lang_name = languages[lang_iso].name
-- [[:Κατηγορία:Προέλευση λέξεων από την πρωτοϊνδοευρωπαϊκή, ρίζες ανά γλώσσα]]
-- [[:Κατηγορία:Προέλευση λέξεων από τα αραβικά, ρίζες ανά γλώσσα]]
		-- PREPARED TEXT: text_lang repeated:
		if languages[lang_iso].sublang == true then
			text = '[[:Κατηγορία:Κατάλογος γλωσσών|Γλώσσα]]: ' 
			.. '[[:Κατηγορία:' .. languages[lang_iso].host .. '|<b>' .. languages[lang_iso].host_show .. '</b>]]'
			.. ' - [[:Κατηγορία:' .. lang_cat .. '|' .. lang_cat .. ']]'
		else
			text = '[[:Κατηγορία:Κατάλογος γλωσσών|Γλώσσα]]: ' 
			.. '[[:Κατηγορία:' .. languages[lang_iso].cat .. '|<b>' .. mw.getContentLanguage():ucfirst(lang_name) .. '</b>]]'
		end
				text = text ..  ' » [[:Κατηγορία:Ετυμολογία (' ..	lang_name .. ')|Ετυμολογία]]' 
				.. ' » [[:Κατηγορία:' .. write_cat .. ' (' ..	lang_name .. ')|' .. write_cat .. ']]'
				.. ' » [[:Κατηγορία:' .. write_cat .. ' ' .. apota_text .. '|' .. apota_text .. ']]'
				.. ' » [[:Κατηγορία:' .. write_cat .. ' ' .. apota_text .. ' - ρίζες|ρίζες]]'
				.. ' » [[:Κατηγορία:' .. page_text .. '|ανά γλώσσα]]'
				-- cat
				if languages[lang_iso].sublang then
					cat = '[[Κατηγορία:' .. write_cat .. ' ' .. apota_text .. '| ]]' .. "\n" -- sort top
					.. '[[Κατηγορία:' .. write_cat .. ' ' .. apota_text .. ' ' .. languages[lang_iso].host_apota .. '|' .. languages[lang_iso].apota_key .. ']]' .. "\n"
				else
					cat = '[[Κατηγορία:' .. write_cat .. ' ' .. apota_text .. '| ]]' .. "\n" -- sort top
					.. '[[Κατηγορία:Ρίζες (' .. lang_name ..  ')| ]]' .. "\n" -- sort top
				end

end -- close if mw.ustring.find(cat_title, 'Προέλευση λέξεων από') and mw.ustring.find(cat_title, 'ρίζες ανά γλώσσα')



--------------------------------------------------------------------------
--                  TOPOS  Θεματικές > ΤΟΠΩΝΥΜΙΑ
--                  TOPOS   Topics  > PLACENAMES                        --
--------------------------------------------------------------------------
-- =============== DATA
-- NEED BOTH [[Module:auto cat/data/topokind]] AND [[Module:topos/kind]] with all parents etc
-- First part of the cat_title is:
-- call [[Module:topos/kind]].kind -- Write topos[toposid].anykeyword e.g. topos[toposid].word_cat is the Category's placename
function get_toposid(toposid)
if mw.ustring.find(cat_title, 'Αεροδρόμια') then toposid = 'αεροδρόμιο' end
if mw.ustring.find(cat_title, 'Ακτές') then toposid = 'ακτή' end
if mw.ustring.find(cat_title, 'Ακρωτήρια') then toposid = 'ακρωτήριο' end
if mw.ustring.find(cat_title, 'Ανάκτορα') then toposid = 'ανάκτορο' end
if mw.ustring.find(cat_title, 'Αποικίες') then toposid = 'αποικία' end
-- αρχαίες  βλ. Ναοί, Περιοχές, Πόλεις, Χώρες
if mw.ustring.find(cat_title, 'Αρχαιολογικοί τόποι') then toposid = 'αρχαιολογικός τόπος' end
if mw.ustring.find(cat_title, 'Αρχιπέλαγα') then toposid = 'αρχιπέλαγος' end
if mw.ustring.find(cat_title, 'Αστέρες') then toposid = 'αστέρας' end
if mw.ustring.find(cat_title, 'Αστερισμοί') then toposid = 'αστερισμός' end
if mw.ustring.find(cat_title, 'Αυτοκρατορίες') then toposid = 'αυτοκρατορία' end
if mw.ustring.find(cat_title, 'Βουνά') then toposid = 'βουνό' end
if mw.ustring.find(cat_title, 'Γέφυρες') then toposid = 'γέφυρα' end
if mw.ustring.find(cat_title, 'Δάση') then toposid = 'δάσος' end
if mw.ustring.find(cat_title, 'Δήμοι') then toposid = 'δήμος' end
if mw.ustring.find(cat_title, 'Διαμερίσματα') then toposid = 'διαμέρισμα' end
if mw.ustring.find(cat_title, 'Διοικητικές υποδιαιρέσεις') then toposid = 'διοικητική υποδιαίρεση' end
if mw.ustring.find(cat_title, 'Διώρυγες') then toposid = 'διώργυα' end
if mw.ustring.find(cat_title, 'Δορυφόροι') then toposid = 'δορυφόρος' end
if mw.ustring.find(cat_title, 'Δουκάτα') then toposid = 'δουκάτο' end
if mw.ustring.find(cat_title, 'Ενορίες') then toposid = 'ενορία' end
if mw.ustring.find(cat_title, 'Έρημοι') then toposid = 'έρημος' end
if mw.ustring.find(cat_title, 'Επαρχίες') then toposid = 'επαρχία' end
if mw.ustring.find(cat_title, 'Ήπειροι') then toposid = 'ήπειρος' end
if mw.ustring.find(cat_title, 'Ηφαίστεια') then toposid = 'ηφαίστειο' end
if mw.ustring.find(cat_title, 'Θάλασσες') then toposid = 'θάλασσα' end
if mw.ustring.find(cat_title, 'Θαλάσσιες περιοχές') then toposid = 'θαλάσσια περιοχή' end
if mw.ustring.find(cat_title, 'Θέματα') then toposid = 'θέμα' end
if mw.ustring.find(cat_title, 'Θέρετρα') then toposid = 'θέρετρο' end
if mw.ustring.find(cat_title, 'Ισθμοί') then toposid = 'ισθμός' end
-- Ιστορικές βλ. Περιοχές, Χώρες
if mw.ustring.find(cat_title, 'Καντόνια') then toposid = 'καντόνι' end
if mw.ustring.find(cat_title, 'Κάστρα') then toposid = 'κάστρο' end
if mw.ustring.find(cat_title, 'Καταρράκτες') then toposid = 'καταρράκτης' end
if mw.ustring.find(cat_title, 'Κατοικημένοι τόποι') then toposid = 'κατοικημένοι τόποι' end
if mw.ustring.find(cat_title, 'Κοιλάδες') then toposid = 'κοιλάδα' end
if mw.ustring.find(cat_title, 'Κοινότητες') then toposid = 'κοινότητα' end
if mw.ustring.find(cat_title, 'Κόλποι') then toposid = 'κόλπος' end
if mw.ustring.find(cat_title, 'Κομητείες') then toposid = 'κομητεία' end
if mw.ustring.find(cat_title, 'Κορυφές βουνών') then toposid = 'κορυφή' end
if mw.ustring.find(cat_title, 'Κρατίδια') then toposid = 'κρατίδιο' end
if mw.ustring.find(cat_title, 'Κτίρια') then toposid = 'κτίριο' end
if mw.ustring.find(cat_title, 'Κωμοπόλεις') then toposid = 'κωμόπολη' end
if mw.ustring.find(cat_title, 'Λιμάνια') then toposid = 'λιμάνι' end
if mw.ustring.find(cat_title, 'Λίμνες') then toposid = 'λίμνη' end
if mw.ustring.find(cat_title, 'Λιμνοθάλασσες') then toposid = 'λιμνοθάλασσα' end
if mw.ustring.find(cat_title, 'Λόφοι') then toposid = 'λόφος' end
if mw.ustring.find(cat_title, 'Μονές') then toposid = 'μονή' end
if mw.ustring.find(cat_title, 'Μουσεία') then toposid = 'μουσείο' end
if mw.ustring.find(cat_title, 'Ναοί') then toposid = 'ναός' end
	if mw.ustring.find(cat_title, 'Αρχαίοι ναοί') then toposid = 'αρχαίος ναός' end
if mw.ustring.find(cat_title, 'Νησιά') then toposid = 'νησί' end
if mw.ustring.find(cat_title, 'Νησίδες') then toposid = 'νησίδα' end
if mw.ustring.find(cat_title, 'Νομοί') then toposid = 'νομός' end
if mw.ustring.find(cat_title, 'Νοσοκομεία') then toposid = 'νοσοκομείο' end
if mw.ustring.find(cat_title, 'Οικισμοί') then toposid = 'οικισμός' end
if mw.ustring.find(cat_title, 'Οροπέδια') then toposid = 'οροπέδιο' end
if mw.ustring.find(cat_title, 'Ορεινά περάσματα') then toposid = 'ορεινό πέρασμα' end
if mw.ustring.find(cat_title, 'Οροσειρές') then toposid = 'οροσειρά' end
if mw.ustring.find(cat_title, 'Πάρκα') then toposid = 'πάρκο' end
if mw.ustring.find(cat_title, 'Πεδιάδες') then toposid = 'πεδιάδα' end
if mw.ustring.find(cat_title, 'Πελάγη') then toposid = 'πέλαγος' end
if mw.ustring.find(cat_title, 'Περιοχές') then toposid = 'περιοχή' end
	if mw.ustring.find(cat_title, 'Αρχαίες περιοχές') then toposid = 'αρχαία περιοχή' end
	if mw.ustring.find(cat_title, 'Ιστορικές περιοχές') then toposid = 'ιστορική περιοχή' end
if mw.ustring.find(cat_title, 'Περιφέρειες') then toposid = 'περιφέρεια' end
if mw.ustring.find(cat_title, 'Πηγές') then toposid = 'πηγή' end
if mw.ustring.find(cat_title, 'Πλανήτες') then toposid = 'πλανήτης' end
if mw.ustring.find(cat_title, 'Πλατείες') then toposid = 'πλατεία' end
if mw.ustring.find(cat_title, 'Πόλεις') then toposid = 'πόλη' end
	if mw.ustring.find(cat_title, 'Αρχαίες πόλεις') then toposid = 'αρχαία πόλη' end
---if mw.ustring.find(cat_title, 'Πόλεις κράτη') then toposid = 'πόλη κράτος' end ΑΦΑΙΡΕΙΤΑΙ: αφορά μόνον αρχαίες ελληνικές Πόλεις
-- IMPOSSIBLE TO SEE DASH -- if mw.ustring.find(cat_title, 'Πόλεις-πρωτεύουσες') then toposid = 'πόλη πρωτεύουσα' end
	-- αλλαγή ονόματος σε Τοπικές πρωτεύουσες
if mw.ustring.find(cat_title, 'Πολιτείες') then toposid = 'πολιτεία' end
if mw.ustring.find(cat_title, 'Πορθμοί') then toposid = 'πορθμός' end
if mw.ustring.find(cat_title, 'Ποταμοί') then toposid = 'ποταμός' end
if mw.ustring.find(cat_title, 'Προάστια') then toposid = 'προάστιο' end
if mw.ustring.find(cat_title, 'Πρωτεύουσες') then toposid = 'πρωτεύουσα' end -- βλ. Τοπικές πρωτεύουσες
if mw.ustring.find(cat_title, 'Ρέματα') then toposid = 'ρέμα' end
if mw.ustring.find(cat_title, 'Σατραπείες') then toposid = 'σατραπεία' end
if mw.ustring.find(cat_title, 'Στάδια') then toposid = 'στάδιο' end
if mw.ustring.find(cat_title, 'Σπήλαια') then toposid = 'σπήλαιο' end
if mw.ustring.find(cat_title, 'Στενά') then toposid = 'στενό' end
if mw.ustring.find(cat_title, 'Σύμπαν') then toposid = 'σύμπαν' end
if mw.ustring.find(cat_title, 'Συνοικίες') then toposid = 'συνοικία' end
if mw.ustring.find(cat_title, 'Συνοικισμοί') then toposid = 'συνοικισμός' end
if mw.ustring.find(cat_title, 'Τοπικές πρωτεύουσες') then toposid = 'τοπική πρωτεύουσα' end
if mw.ustring.find(cat_title, 'Τοποθεσίες') then toposid = 'τοποθεσία' end

-- PROBLEMS with id τοπωνύμιο [[:Κατηγορία:Τοπωνυμίες (αρχαία ελληνικά)]]
-- NOT Τοπωνύμια it clashes with all stadnard rules
-- 2020 July, it works, but I do not want the SAME category as the general
--if mw.ustring.find(cat_title, 'Τοπωνύμια') then toposid = 'τοπωνύμιο' end -- [[Module:topos/kind]] special kind key for auto cat
-- 2021 September
if mw.ustring.find(cat_title, 'Τοπωνυμίες') then toposid = 'τοπωνύμιο' end -- 2021.09.05. works [[:Κατηγορία:Τοπωνυμίες (αρχαία ελληνικά)]]
	-- together with [[Module:auto cat/data/toposkind]] Τοπωνυμίες 
	-- AND [[Module:topos/kind]]
	-- BUT ALSO NEED
if mw.ustring.find(cat_title, 'Τοπωνύμια') then toposid = 'τοπωνύμιο2' end
	-- check [[:Κατηγορία:Τοπωνύμια της Αγκόλας]]

if mw.ustring.find(cat_title, 'Υδραγωγεία') then toposid = 'υδραγωγείο' end
if mw.ustring.find(cat_title, 'Υπερπόντιες κτήσεις') then toposid = 'υπερπόντια κτήση' end
if mw.ustring.find(cat_title, 'Ύφαλοι') then toposid = 'ύφαλος' end
if mw.ustring.find(cat_title, 'Φαράγγια') then toposid = 'φαράγγι' end
if mw.ustring.find(cat_title, 'Φάροι') then toposid = 'φάρος' end
if mw.ustring.find(cat_title, 'Φιορδ') then toposid = 'φιορδ' end
if mw.ustring.find(cat_title, 'Χείμαρροι') then toposid = 'χείμαρρος' end
if mw.ustring.find(cat_title, 'Χερσόνησοι') then toposid = 'χερσόνησος' end
if mw.ustring.find(cat_title, 'Χώρες') then toposid = 'χώρα' end
	if mw.ustring.find(cat_title, 'Αρχαίες χώρες') then toposid = 'αρχαία χώρα' end
	if mw.ustring.find(cat_title, 'Ιστορικές χώρες') then toposid = 'ιστορική χώρα' end
if mw.ustring.find(cat_title, 'Χωριά') then toposid = 'χωριό' end
if mw.ustring.find(cat_title, 'Ωκεανοί') then toposid = 'ωκεανός' end

	if toposid ~= '' and toposid ~= nil then
	return toposid
	else
		-- do nothing, otherwise it spoils ALL categories
	end
end


-- ================= GENERAL TITLES - ΜΟΝΟ ΓΕΝΙΚΕΣ ΕΠΙΚΕΦΑΛΙΔΕΣ
-- ----------------- ΤΟΠΩΝΥΜΙΑ  - placenames 
	if cat_title == 'Τοπωνύμια' then
-- a mode -- [[:Κατηγορία:Τοπωνύμια]]
		if cat_parenthesis == '' or cat_parenthesis == nil then
			text = text_wikt .. ' » [[:Κατηγορία:Θεματικές κατηγορίες|Θεματικές κατηγορίες]]' 
			.. ' » [[:Κατηγορία:Ονομασίες|Ονομασίες]]' 
			.. ' » [[:Κατηγορία:Τοπωνύμια|<b>Τοπωνύμια</b>]]' 
			.. ' » [[:Κατηγορία:Τοπωνύμια ανά είδος|<b>ανά είδος</b>]]'
			.. ' :: [[:Κατηγορία:Τοπωνύμια ανά τόπο|<b>ανά τόπο</b>]]'
			 cat = '[[Κατηγορία:Ονομασίες| τοπωνυμια]]' .. "\n" -- sort top		
			.. '[[Κατηγορία:Θεματικές κατηγορίες|τοπωνυμια]]' .. "\n"
			.. '[[Κατηγορία:Κύρια ονόματα| τοπωνυμια]]' .. "\n" -- sort top
		else
-- b mode -- [[:Κατηγορία:Τοπωνύμια (νέα ελληνικά)]]
			text = text_lang .. ' » [[:Κατηγορία:Θεματικές κατηγορίες (' .. lang_name .. ')|Θεματικές κατηγορίες]]' 
			.. ' » [[:Κατηγορία:Ονομασίες (' .. lang_name .. ')|Ονομασίες]]' 
			.. ' » [[:Κατηγορία:Τοπωνύμια (' .. lang_name ..  ')|<b>Τοπωνύμια</b>]]'  
			.. ' » [[:Κατηγορία:Τοπωνύμια ανά είδος (' .. lang_name .. ')|<b>ανά είδος</b>]]'  
			.. ' :: [[:Κατηγορία:Τοπωνύμια ανά τόπο (' .. lang_name .. ')|<b>ανά τόπο</b>]]'
			.. '  [[:Κατηγορία:Τοπωνύμια|«««]]' 
			-- [[:Κατηγορία:Τοπωνύμια (ελληνιστική κοινή)]]
			if languages[lang_iso].sublang == true then
			text = text .. ' [[:Κατηγορία:Τοπωνύμια (' .. languages[lang_iso].host_name .. ')|«' .. languages[lang_iso].host_name .. ']]'
			end
			cat =  '[[Κατηγορία:Τοπωνύμια|' .. lang_key .. ']]' .. "\n"
			.. '[[Κατηγορία:Ονομασίες (' .. lang_name .. ')|τοπωνυμια]]' .. "\n"
			.. '[[Κατηγορία:Θεματικές κατηγορίες (' .. lang_name .. ')|τοπωνυμια]]' .. "\n"
			.. '[[Κατηγορία:Κύρια ονόματα (' .. lang_name .. ')|τοπωνυμια]]' .. "\n"
			if languages[lang_iso].sublang == true then
			cat = cat .. '[[Κατηγορία:Τοπωνύμια (' .. languages[lang_iso].host_name ..  ')|' .. languages[lang_iso].host_key .. ']]' .. "\n"
			end
		end
	end

-- ----------------- ΤΟΠΩΝΥΜΙΑ ΑΝΑ ΕΙΔΟΣ - placenames by kind
	if cat_title == 'Τοπωνύμια ανά είδος' then
-- a mode [[:Κατηγορία:Τοπωνύμια ανά είδος]]
		if cat_parenthesis == '' or cat_parenthesis == nil then
			text = text_wikt .. ' » [[:Κατηγορία:Θεματικές κατηγορίες|Θεματικές κατηγορίες]]' 
			.. ' » [[:Κατηγορία:Ονομασίες|Ονομασίες]]' 
			.. ' » [[:Κατηγορία:Τοπωνύμια|<b>Τοπωνύμια</b>]]' .. ' » <b>ανά είδος</b>'
			.. ' :: [[:Κατηγορία:Τοπωνύμια ανά τόπο|<b>ανά τόπο</b>]]'
			 cat = '[[Κατηγορία:Τοπωνύμια| αναειδοσ]]' .. "\n" -- sort top
		else
-- b mode -- NO lang. cf  [[:Κατηγορία:Τοπωνύμια (νέα ελληνικά)]]
			text = text_lang .. ' » [[:Κατηγορία:Θεματικές κατηγορίες (' .. lang_name .. ')|Θεματικές κατηγορίες]]' 
			.. ' » [[:Κατηγορία:Ονομασίες (' .. lang_name .. ')|Ονομασίες]]' 
			.. ' » [[:Κατηγορία:Τοπωνύμια (' .. lang_name .. ')|<b>Τοπωνύμια</b>]]' .. ' » <b>ανά είδος</b>'
			.. '  [[:Κατηγορία:Τοπωνύμια ανά είδος|«««]]'
			.. ' :: [[:Κατηγορία:Τοπωνύμια ανά τόπο (' .. lang_name ..  ')|<b>ανά τόπο</b>]]'
			if languages[lang_iso].sublang == true then
			text = text .. ' [[:Κατηγορία:Τοπωνύμια ανά είδος (' .. languages[lang_iso].host_name .. ')|«' .. languages[lang_iso].host_name .. ']]'
			end
			cat = '[[Κατηγορία:Τοπωνύμια (' .. lang_name .. ')| αναειδοσ]]' .. "\n" -- sort top
			if languages[lang_iso].sublang == true then
			cat = cat .. '[[Κατηγορία:Τοπωνύμια ανά είδος (' .. languages[lang_iso].host_name ..  ')|' .. languages[lang_iso].host_key .. ']]' .. "\n"
			end	
		end
	end

-- ----------------- ΤΟΠΩΝΥΜΙΑ ΑΝΑ ΤΟΠΟ placenames by place
	if cat_title == 'Τοπωνύμια ανά τόπο' then
-- a mode -- [[:Κατηγορία:Τοπωνύμια ανά τόπο]]
		if cat_parenthesis == '' or cat_parenthesis == nil then
			text = text_wikt .. ' » [[:Κατηγορία:Θεματικές κατηγορίες|Θεματικές κατηγορίες]]' 
			.. ' » [[:Κατηγορία:Ονομασίες|Ονομασίες]]'
			.. ' » [[:Κατηγορία:Τοπωνύμια|<b>Τοπωνύμια</b>]]' .. ' » [[:Κατηγορία:Τοπωνύμια ανά είδος|<b>ανά είδος</b>]]' 
			.. ' :: <b>ανά τόπο</b>'
			 cat = '[[Κατηγορία:Τοπωνύμια| ανατοπο]]' .. "\n" -- sort top
		else
-- b mode -- [[:Κατηγορία:Τοπωνύμια ανά τόπο (νέα ελληνικά)]], Τοπωνύμια (νέα ελληνικά) = Τοπωνυμία ανά είδος (νέα ελληνικά)
			text = text_lang .. ' » [[:Κατηγορία:Θεματικές κατηγορίες (' .. lang_name .. ')|Θεματικές κατηγορίες]]' 
			.. ' » [[:Κατηγορία:Ονομασίες (' .. lang_name .. ')|Ονομασίες]]' 
			.. ' » [[:Κατηγορία:Τοπωνύμια (' .. lang_name .. ')|<b>Τοπωνύμια</b>]]'
			.. ' » [[:Κατηγορία:Τοπωνύμια ανά είδος (' .. lang_name .. ')|<b>ανά είδος</b>]]'
			.. ' :: <b>ανά τόπο</b>'
			.. '  [[:Κατηγορία:Τοπωνύμια ανά τόπο|«««]]'
			if languages[lang_iso].sublang == true then
			text = text .. ' [[:Κατηγορία:Τοπωνύμια ανά τόπο (' .. languages[lang_iso].host_name .. ')|«' .. languages[lang_iso].host_name .. ']]'
			end	
			cat = '[[Κατηγορία:Τοπωνύμια ανά τόπο|' .. lang_key .. ']]' .. "\n"
			.. '[[Κατηγορία:Τοπωνύμια (' .. lang_name .. ')| ανατοπο]]' .. "\n" -- sort top
			if languages[lang_iso].sublang == true then
			cat = cat .. '[[Κατηγορία:Τοπωνύμια ανά τόπο (' .. languages[lang_iso].host_name ..  ')|' .. languages[lang_iso].host_key .. ']]' .. "\n"
			end		
		end
	end


-- ----------------- ΤΟΠΩΝΥΜΙΑ ΑΝΑ ΕΙΔΟΣ ΚΑΙ ΑΝΑ ΤΟΠΟ placenames by kind and by place
	if cat_title == 'Τοπωνύμια ανά είδος και ανά τόπο' then
-- a mode -- [[:Κατηγορία:Τοπωνύμια ανά είδος και ανά τόπο]]
		if cat_parenthesis == '' or cat_parenthesis == nil then
			text = text_wikt .. ' » [[:Κατηγορία:Θεματικές κατηγορίες|Θεματικές κατηγορίες]]' 
			.. ' » [[:Κατηγορία:Ονομασίες|Ονομασίες]]'
			.. ' » [[:Κατηγορία:Τοπωνύμια|<b>Τοπωνύμια</b>]]' .. ' » [[:Κατηγορία:Τοπωνύμια ανά είδος|<b>ανά είδος</b>]]'
			.. ' :: [[:Κατηγορία:Τοπωνύμια ανά τόπο|<b>ανά τόπο</b>]]'
			.. ' :: <b>ανά είδος και τόπο</b>'
			 cat = '[[Κατηγορία:Τοπωνύμια| αναειδοσκαιτοπο]]' .. "\n" -- sort top
			.. '[[Κατηγορία:Τοπωνύμια ανά είδος| αναειδοσκαιτοπο]]' .. "\n" -- sort top
			.. '[[Κατηγορία:Τοπωνύμια ανά τόπο| !αναειδοσκαιτοπο]]' .. "\n" -- sort top !

		else
-- b mode -- [[:Κατηγορία:Τοπωνύμια ανά είδος και ανά τόπο (νέα ελληνικά)]]
			text = text_lang .. ' » [[:Κατηγορία:Θεματικές κατηγορίες (' .. lang_name .. ')|Θεματικές κατηγορίες]]' 
			.. ' » [[:Κατηγορία:Ονομασίες (' .. lang_name .. ')|Ονομασίες]]' 
			.. ' » [[:Κατηγορία:Τοπωνύμια (' .. lang_name .. ')|<b>Τοπωνύμια</b>]]'  
			.. ' » [[:Κατηγορία:Τοπωνύμια ανά είδος (' .. lang_name ..  ')|<b>ανά είδος</b>]]'  
			.. ' :: [[:Κατηγορία:Τοπωνύμια ανά τόπο (' .. lang_name ..  ')|<b>ανά τόπο</b>]]'
			.. ' :: <b>ανά είδος και τόπο</b>'
			if languages[lang_iso].sublang == true then
			text = text .. ' [[:Κατηγορία:Τοπωνύμια ανά είδος και ανά τόπο (' .. languages[lang_iso].host_name .. ')|«' .. languages[lang_iso].host_name .. ']]'
			end	
			cat = '[[Κατηγορία:Τοπωνύμια ανά τόπο|' .. lang_key .. ']]' .. "\n"
			.. '[[Κατηγορία:Τοπωνύμια (' .. lang_name .. ')| αναειδοσκαιτοπο]]' .. "\n" -- sort top
			.. '[[Κατηγορία:Τοπωνύμια ανά είδος (' .. lang_name .. ')| αναειδοσκαιτοπο]]' .. "\n" -- sort top
			.. '[[Κατηγορία:Τοπωνύμια ανά τόπο (' .. lang_name .. ')| !αναειδοσκαιτοπο]]' .. "\n" -- sort top !
			if languages[lang_iso].sublang == true then
			cat = cat .. '[[Κατηγορία:Τοπωνύμια ανά είδος και ανά τόπο (' .. languages[lang_iso].host_name ..  ')|' .. languages[lang_iso].host_key .. ']]' .. "\n"
			end		
		end
	end


-- ================= SPECIFIC kind of place TITLES - ΕΠΙΚΕΦΑΛΙΔΕΣ ΕΙΔΟΥΣ
--------------------------------------------------------------------------
--              topos -  [[Module:topos/kinds]] with NO where
--   ΕΙΔΗ τοπωνυμίων: kinds of places ΧΩΡΙΣ where 'της... τάδε χώρας'
--------------------------------------------------------------------------

-- ======by place========= kind of topos ΑΝΑ ΤΟΠΟ placenames by place
 
if mw.ustring.match(cat_title, '(.*) ανά τόπο') then toposid = get_toposid(cat_title) end

	if mw.ustring.find(cat_title, 'ανά τόπο') and not mw.ustring.find(cat_title, 'Τοπωνύμια') then
-- a mode
		if cat_parenthesis == '' or cat_parenthesis == nil then
			text = text_wikt .. ' » [[:Κατηγορία:Θεματικές κατηγορίες|Θεματικές κατηγορίες]]' 
			.. ' » [[:Κατηγορία:Ονομασίες|Ονομασίες]]'
			.. ' » [[:Κατηγορία:Τοπωνύμια|<b>Τοπωνύμια</b>]]' .. ' » [[:Κατηγορία:Τοπωνύμια ανά είδος|<b>ανά είδος</b>]]'  
			if topos[toposid].parent4 ~= '' and topos[toposid].parent4 ~= nil then
				text = text .. ' » [[:Κατηγορία:' .. topos[toposid].parent4 .. '|' .. topos[toposid].parent4 .. ']]'
			end	
			if topos[toposid].parent3 ~= '' and topos[toposid].parent3 ~= nil then
				text = text .. ' » [[:Κατηγορία:' .. topos[toposid].parent3  .. '|' .. topos[toposid].parent3 .. ']]'
			end	
			if topos[toposid].parent2 ~= '' and topos[toposid].parent2 ~= nil then
				text = text .. ' » [[:Κατηγορία:' .. topos[toposid].parent2 .. '|' .. topos[toposid].parent2 .. ']]'
			end	
			if topos[toposid].parent ~= '' and topos[toposid].parent ~= nil then
				text = text .. ' » [[:Κατηγορία:' .. topos[toposid].parent .. '|' .. topos[toposid].parent .. ']]'
			end	
			text = text .. ' » [[:Κατηγορία:' .. topos[toposid].word_cat .. '|' .. topos[toposid].word_cat .. ']]'
--			text = text .. ' » [[:Κατηγορία:Τοπωνύμια ανά τόπο|ανά τόπο]]' 
			text = text .. ' :: [[:Κατηγορία:' .. cat_title .. '|' .. '<b>ανά τόπο</b>' .. ']]'  -- textit -- says 'ανά τόπο' but has an arrow Κατηγορία:Αεροδρόμια ανά τόπο
			if topos[toposid].extra1 ~= '' and topos[toposid].extra1 ~= nil then
				text = text .. ' « [[:Κατηγορία:' .. topos[toposid].extra1 .. '|' .. topos[toposid].extra1 .. ']]'
			end
			-- descr -- [[:Κατηγορία:Διαμερίσματα ανά τόπο]]
			if topos[toposid].descr ~= '' and topos[toposid].descr ~= nil then
				text_plus = '<dl><dd>' .. topos[toposid].descr .. '</dd></dl>'
			end	

			 cat = '[[Κατηγορία:Τοπωνύμια ανά είδος και ανά τόπο|' .. topos[toposid].key .. ']]' .. "\n"
			.. '[[Κατηγορία:' .. topos[toposid].word_cat .. '| ανατοπο]]' .. "\n" -- sort top
			if topos[toposid].parent ~= '' and topos[toposid].parent ~= nil then
				cat = cat .. '[[Κατηγορία:' .. topos[toposid].parent .. ' ανά τόπο| ' .. topos[toposid].key .. ']]' .. "\n" -- sort top
			end
		else
-- b mode -- [[:Κατηγορία:Αεροδρόμια ανά τόπο (νέα ελληνικά)]]
			text = text_lang .. ' » [[:Κατηγορία:Θεματικές κατηγορίες (' .. lang_name .. ')|Θεματικές κατηγορίες]]' 
			.. ' » [[:Κατηγορία:Ονομασίες (' .. lang_name .. ')|Ονομασίες]]' 
			.. ' » [[:Κατηγορία:Τοπωνύμια (' .. lang_name ..  ')|<b>Τοπωνύμια</b>' .. ' » <b>ανά είδος</b>]]'  
			if topos[toposid].parent4 ~= '' and topos[toposid].parent4 ~= nil then
				text = text .. ' » [[:Κατηγορία:' .. topos[toposid].parent4 .. ' (' .. lang_name .. ')|' .. topos[toposid].parent4 .. ']]'
			end	
			if topos[toposid].parent3 ~= '' and topos[toposid].parent3 ~= nil then
				text = text .. ' » [[:Κατηγορία:' .. topos[toposid].parent3  .. ' (' .. lang_name .. ')|' .. topos[toposid].parent3 .. ']]'
			end	
			if topos[toposid].parent2 ~= '' and topos[toposid].parent2 ~= nil then
				text = text .. ' » [[:Κατηγορία:' .. topos[toposid].parent2 .. ' (' .. lang_name .. ')|' .. topos[toposid].parent2 .. ']]'
			end	
			if topos[toposid].parent ~= '' and topos[toposid].parent ~= nil then
				text = text .. ' » [[:Κατηγορία:' .. topos[toposid].parent .. ' (' .. lang_name .. ')|' .. topos[toposid].parent .. ']]'
			end	
			text = text .. ' :: [[:Κατηγορία:Τοπωνύμια ανά τόπο (' .. lang_name .. ')|ανά τόπο]]' 
			text = text .. textit_lang
			.. ' [[:Κατηγορία:' .. cat_title .. '|«««]]'
			-- [[:Κατηγορία:Κάστρα ανά τόπο (ελληνιστική κοινή)]]
			if languages[lang_iso].sublang == true then
			text = text .. ' [[:Κατηγορία:' .. cat_title .. ' (' .. languages[lang_iso].host_name .. ')|«' .. languages[lang_iso].host_name .. ']]'
			end
			if topos[toposid].extra1 ~= '' and topos[toposid].extra1 ~= nil then
				text = text .. ' « [[:Κατηγορία:' .. topos[toposid].extra1 .. ' (' .. lang_name .. ')|' .. topos[toposid].extra1 .. ']]'
			end
			-- descr -- [[:Κατηγορία:Διαμερίσματα (νέα ελληνικά)]]
			if topos[toposid].descr ~= '' and topos[toposid].descr ~= nil then
				text_plus = '<dl><dd>' .. topos[toposid].descr .. '</dd></dl>'
			end	

			-- cat b [[:Κατηγορία:Αρχιπέλαγα ανά τόπο (νέα ελληνικά)]] +parent
			cat = '[[Κατηγορία:Τοπωνύμια ανά είδος και ανά τόπο (' .. lang_name .. ')|' .. topos[toposid].key .. ']]' .. "\n"
			.. '[[Κατηγορία:' .. topos[toposid].word_cat .. ' ανά τόπο|' .. lang_key .. ']]' .. "\n"
			.. '[[Κατηγορία:' .. topos[toposid].word_cat .. ' (' .. lang_name .. ')| ανατοπο]]' .. "\n" -- sort top
			if topos[toposid].parent ~= '' and topos[toposid].parent ~= nil then
				cat = cat .. '[[Κατηγορία:' .. topos[toposid].parent .. ' ανά τόπο (' .. lang_name .. ')| ' .. topos[toposid].key .. ']]' .. "\n" -- sort top
			end
			if languages[lang_iso].sublang == true then
			cat = cat .. '[[Κατηγορία:' .. cat_title .. ' (' .. languages[lang_iso].host_name ..  ')|' .. languages[lang_iso].host_key .. ']]' .. "\n"
			end	
		end -- close catparenthesis
	end -- close if mw.ustring.find(cat_title, 'ανά τόπο') and not mw.ustring.find(cat_title, 'Τοπωνύμια') 



-- =====ανά είδος by kind========== all places, NO where EXCEPT the word 'Τοπωνύμια'
if toposkind.label[cat_title] then -- but not find 'ανά τόπο' 
	-- PROBLEM DO NOT make subcategory = Τοπωνύμια [[:Κατηγορία:Τοπωνύμια (νέα ελληνικά)]] It repeats itselft in the category.
	--  and not toposkind.label['Τοπωνύμια'] 
	-- I took off ['Τοπωνύμια' from [[Module:auto cat/data/toposkind]] - NOT regarded as one of the others.
toposid = get_toposid(cat_title)
-- a mode -- [[:Κατηγορία:Αεροδρόμια]] +extra1, -- [[:Κατηγορία:Ωκεανοί]] +parent
	-- always CHECK PROBLEMS AT [[:Κατηγορία:Δάνεια]] ~~~~ [[:Κατηγορία:Τοπωνύμια ανά είδος]]
		if cat_parenthesis == '' or cat_parenthesis == nil then
			text = text_wikt .. ' » [[:Κατηγορία:Θεματικές κατηγορίες|Θεματικές κατηγορίες]]' 
			.. ' » [[:Κατηγορία:Ονομασίες|Ονομασίες]] » [[:Κατηγορία:Τοπωνύμια|<b>Τοπωνύμια</b>]] » [[:Κατηγορία:Τοπωνύμια ανά είδος|ανά είδος]]' 
			if topos[toposid].parent4 ~= '' and topos[toposid].parent4 ~= nil then
				text = text .. ' » [[:Κατηγορία:' .. topos[toposid].parent4 .. '|' .. topos[toposid].parent4 .. ']]'
			end	
			if topos[toposid].parent3 ~= '' and topos[toposid].parent3 ~= nil then
				text = text .. ' » [[:Κατηγορία:' .. topos[toposid].parent3  .. '|' .. topos[toposid].parent3 .. ']]'
			end	
			if topos[toposid].parent2 ~= '' and topos[toposid].parent2 ~= nil then
				text = text .. ' » [[:Κατηγορία:' .. topos[toposid].parent2 .. '|' .. topos[toposid].parent2 .. ']]'
			end	
			if topos[toposid].parent ~= '' and topos[toposid].parent ~= nil then
				text = text .. ' » [[:Κατηγορία:' .. topos[toposid].parent .. '|' .. topos[toposid].parent .. ']]'
			end	
			text = text .. textit
			-- by place NOT Δορυφόροι, Ήπειροι, Πλανήτες, Ωκεανοί
			if toposid == 'αστέρας' or toposid == 'αστερισμός' or toposid == 'δορυφόρος' or toposid == 'ήπειρος' 
				or toposid == 'πλανήτης' or toposid == 'σύμπαν' or toposid == 'ωκεανός' 
				then
				text = text
			else
				text = text .. ' :: [[:Κατηγορία:' .. topos[toposid].word_cat .. ' ανά τόπο|ανά τόπο]]' 
			end
			if topos[toposid].extra1 ~= '' and topos[toposid].extra1 ~= nil then
				text = text .. ' « [[:Κατηγορία:' .. topos[toposid].extra1 .. '|' .. topos[toposid].extra1 .. ']]'
			end
			-- descr -- [[:Κατηγορία:Διαμερίσματα]]
			if topos[toposid].descr ~= '' and topos[toposid].descr ~= nil then
				text_plus = '<dl><dd>' .. topos[toposid].descr .. '</dd></dl>'
			end	
			
			-- cat a -- [[:Κατηγορία:Οροσειρές]]
--			cat = '[[Κατηγορία:' .. topos[toposid].word_cat .. ' ανά τόπο| ' .. topos[toposid].key .. ']]'..  "\n" -- sort top
			if topos[toposid].parent ~= '' and topos[toposid].parent ~= nil then
				cat = '[[Κατηγορία:' .. topos[toposid].parent .. '| ' .. topos[toposid].key .. ']]' .. "\n" -- sort top
			end
			-- the standards
			cat = cat .. '[[Κατηγορία:Τοπωνύμια ανά είδος|' .. topos[toposid].key .. ']]'
			.. '[[Κατηγορία:Θεματικές κατηγορίες|' .. topos[toposid].key .. ']]'
			if topos[toposid].extra1 ~= '' and topos[toposid].extra1 ~= nil then
				cat = cat .. '[[Κατηγορία:' .. topos[toposid].extra1 .. '| ' .. topos[toposid].key .. ']]' ..  "\n" -- sort top
			end
			if topos[toposid].extra2 ~= '' and topos[toposid].extra2 ~= nil then
				cat = cat .. '[[Κατηγορία:' .. topos[toposid].extra2 .. '| ' .. topos[toposid].key .. ']]' ..  "\n" -- sort top
			end
			if topos[toposid].extra3 ~= '' and topos[toposid].extra3 ~= nil then
				cat = cat .. '[[Κατηγορία:' .. topos[toposid].extra3 .. '| ' .. topos[toposid].key .. ']]' ..  "\n" -- sort top
			end
			
		else -- + language
-- b mode [[Κατηγορία:Αεροδρόμια (νέα ελληνικά)]]
			text = text_lang .. ' » [[:Κατηγορία:Θεματικές κατηγορίες (' .. lang_name .. ')|Θεματικές κατηγορίες]]' 
			.. ' » [[:Κατηγορία:Ονομασίες (' .. lang_name .. ')|Ονομασίες]]'
			.. ' » [[:Κατηγορία:Τοπωνύμια (' .. lang_name ..  ')|<b>Τοπωνύμια</b>]]'
			.. ' » [[:Κατηγορία:Τοπωνύμια ανά είδος (' .. lang_name ..  ')|<b>ανά είδος</b>]]'
			if topos[toposid].parent4 ~= '' and topos[toposid].parent4 ~= nil then
				text = text .. ' » [[:Κατηγορία:' .. topos[toposid].parent4 .. ' (' .. lang_name .. ')|' .. topos[toposid].parent4 .. ']]'
			end	
			if topos[toposid].parent3 ~= '' and topos[toposid].parent3 ~= nil then
				text = text .. ' » [[:Κατηγορία:' .. topos[toposid].parent3  .. ' (' .. lang_name .. ')|' .. topos[toposid].parent3 .. ']]'
			end	
			if topos[toposid].parent2 ~= '' and topos[toposid].parent2 ~= nil then
				text = text .. ' » [[:Κατηγορία:' .. topos[toposid].parent2 .. ' (' .. lang_name .. ')|' .. topos[toposid].parent2 .. ']]'
			end	
			if topos[toposid].parent ~= '' and topos[toposid].parent ~= nil then
				text = text .. ' » [[:Κατηγορία:' .. topos[toposid].parent .. ' (' .. lang_name .. ')|' .. topos[toposid].parent .. ']]'
			end	
			text = text .. textit_lang
			.. ' [[:Κατηγορία:' .. cat_title .. '|«««]]'
			-- [[:Κατηγορία:Κάστρα (ελληνιστική κοινή)]]
			if languages[lang_iso].sublang == true then
			text = text .. ' [[:Κατηγορία:' .. cat_title .. ' (' .. languages[lang_iso].host_name .. ')|«' .. languages[lang_iso].host_name .. ']]'
			end
			-- by place NOT Δορυφόροι, Ήπειροι, Πλανήτες, Ωκεανοί
			if toposid == 'αστέρας' or toposid == 'αστερισμός' or toposid == 'δορυφόρος' or toposid == 'ήπειρος' 
				or toposid == 'πλανήτης' or toposid == 'σύμπαν' or toposid == 'ωκεανός' 
				then
				text = text
			else
				text = text .. ' :: [[:Κατηγορία:' .. topos[toposid].word_cat .. ' ανά τόπο (' .. lang_name .. ')|ανά τόπο]]' 
			end
			if topos[toposid].extra1 ~= '' and topos[toposid].extra1 ~= nil then
				text = text .. ' « [[:Κατηγορία:' .. topos[toposid].extra1 .. ' (' .. lang_name .. ')|' .. topos[toposid].extra1 .. ']]'
			end
			-- descr -- [[:Κατηγορία:Διαμερίσματα (νέα ελληνικά)]]
			if topos[toposid].descr ~= '' and topos[toposid].descr ~= nil then
				text_plus = '<dl><dd>' .. topos[toposid].descr .. '</dd></dl>'
			end	
			

			-- cat b lang
			cat = '[[Κατηγορία:' .. cat_title .. '|' .. lang_key .. ']]' .. "\n"
--			.. '[[Κατηγορία:' .. topos[toposid].word_cat .. ' ανά τόπο (' .. lang_name .. ')|' .. topos[toposid].key .. ']]'..  "\n"
			if topos[toposid].parent ~= '' and topos[toposid].parent ~= nil then
				cat = cat .. '[[Κατηγορία:' .. topos[toposid].parent .. ' (' .. lang_name .. ')| ' .. topos[toposid].key .. ']]' .. "\n" -- sort top [[:Κατηγορία:Κωμοπόλεις (ιταλικά)]]
			end
			-- the standards
			cat = cat .. '[[Κατηγορία:Τοπωνύμια ανά είδος (' .. lang_name .. ')|' .. topos[toposid].key .. ']]' .. "\n"
			.. '[[Κατηγορία:Θεματικές κατηγορίες (' .. lang_name .. ')|' .. topos[toposid].key .. ']]' .. "\n"
			if languages[lang_iso].sublang == true then
			cat = cat .. '[[Κατηγορία:' .. cat_title .. ' (' .. languages[lang_iso].host_name ..  ')|' .. languages[lang_iso].host_key .. ']]' .. "\n"
			end	
			-- extras
			if topos[toposid].extra1 ~= '' and topos[toposid].extra1 ~= nil then
				cat = cat .. '[[Κατηγορία:' .. topos[toposid].extra1 .. ' (' .. lang_name .. ')| ' .. topos[toposid].key .. ']]' .. "\n" -- sort top
			end
			if topos[toposid].extra2 ~= '' and topos[toposid].extra2 ~= nil then
				cat = cat .. '[[Κατηγορία:' .. topos[toposid].extra2 .. ' (' .. lang_name .. ')| ' .. topos[toposid].key .. ']]' .. "\n" -- sort top
			end
			
			
		end -- close catparenthesis
	end -- close if mw.ustring.match(cat_title, topos[toposid].word_cat)
--end -- CLOSE get_toposid(cat_title)

--------------------------------------------------------------------------
--             topos+where -  [[Module:topos/where]]
--            FUNCTIONS from where for της // του // των
-- >> parent4 >> parent3 >> parent2 >> parent > CAT << extra1  (extra = topic NOT place)
--------------------------------------------------------------------------

-- ========================== της...  [[:Κατηγορία:Αεροδρόμια της Ελλάδας]] -- [[:Κατηγορία:Αεροδρόμια της Ελλάδας (νέα ελληνικά)]]
-- avoid patterns της as in intitle:/ της / for Κατηγορία 
--[=[ DIVISIONS
[[:Κατηγορία:Τοπωνύμια ανά τόπο]] (by place) should NOT have periphery divisions (they are TOO many).  Because we have a..z by place PLUS a...z by languages
e.g. Τοπωνύμια της Ελλάδας, της Αττικής, του Πειραιά.
Also 'kinds' like Κατηγορία:Αεροδρόμια ανά τόπο etc
It is the judgement of the editor to stop some divisions entering the Κατηγορία:Τοπωνύμια ανά τόπο
with parameter division=1 (only the first, e.g. only country)
TEST: [[:Κατηγορία:Κτίρια της Βοιωτίας]] [[:Κατηγορία:Τοπωνύμια της Βοιωτίας]] NOT under  Κτίρια ανά τόπο, Τοπωνύμια ανά τόπο
mode b [[:Κατηγορία:Τοπωνύμια ανά τόπο (νέα ελληνικά)]] is not a problem.
]=]--

function get_where_text(where_text)
	if mw.ustring.find(cat_title, ' της ') 
	and not mw.ustring.find(cat_title, ' της εβδομάδας') and not mw.ustring.find(cat_title, ' της καθαρεύουσας') 
	and not mw.ustring.find(cat_title, 'Ποικιλίες της') and not mw.ustring.find(cat_title, 'Διάλεκτοι της') 
	and not mw.ustring.find(cat_title, 'Διαλεκτικά της') and not mw.ustring.find(cat_title, 'Διάλεκτοι της')  
	and not mw.ustring.find(cat_title, 'Γερμανικά της Πενσυλβανίας') and not mw.ustring.find(cat_title, 'Φιλιππινέζικα της κεντρικής Μπικόλ')
	then
		where_text = 'της ' .. mw.ustring.sub(mw.ustring.match(cat_title, " της (.*)"), 1, -1)
	end
return where_text
end

function get_where(whereid)
	whereid = require("Module:topos/functions").catword_to_firstwhere(get_where_text(where_text))
return whereid
end

function get_topos_wherelabel(toposwhere_label)
	length = mw.ustring.len(get_where_text(where_text))
	toposwhere_label = mw.ustring.sub(cat_title, 1, -length-1) -- length gives me: Label τ  So, i substract one more. e.g. της Ελλάδας
return toposwhere_label
end

function get_toposkind_id(toposid)
	if mw.ustring.find(cat_title, toposwhere_label) then
	toposid = get_toposid(toposwhere_label)
	end
return toposid
end


-- ---------------------- application της
-- DOUBLE: Russia (Europe, Asia) -also Turkey

-- ΔΙΠΛΗ ΥΠΑΓΩΓΗ: Ρωσία (βλ. στην Ευρώπη / στην Ασία)
if mw.ustring.find(cat_title, ' της Ρωσίας') and not mw.ustring.find(cat_title, ' της Ρωσίας στην Ευρώπη')
	and not mw.ustring.find(cat_title, ' της Ρωσίας στην Ασία')
	then
	toposwhere_label = 'της Ρωσίας'
	whereid = 'Ρωσία'
	toposid = get_toposkind_id('της Ρωσίας')
		if cat_parenthesis == '' or cat_parenthesis == nil then
			text = text_wikt .. ' » [[:Κατηγορία:Θεματικές κατηγορίες|Θεματικές κατηγορίες]]' 
			.. ' » [[:Κατηγορία:Ονομασίες|Ονομασίες]]' 
			.. ' » [[:Κατηγορία:Τοπωνύμια|<b>Τοπωνύμια</b>]]' 
			.. ' » [[:Κατηγορία:Τοπωνύμια ανά είδος|ανά είδος]]' 
			if mw.ustring.find(cat_title, 'Τοπωνύμια') then 
			text = text ..  '<dl><dd>Δείτε [[:Κατηγορία:Τοπωνύμια της Ρωσίας στην Ευρώπη]] ή  [[:Κατηγορία:Τοπωνύμια της Ρωσίας στην Ασία]]</dd></dl>'
			else -- by place
			text = text .. ' :: [[:Κατηγορία:' .. topos[toposid].word_cat .. ' ανά τόπο|ανά τόπο]]' 
-- extra	
			-- it will write nothing for no parent categories like Αεροδρόμια
			-- it should write Κατηγορία: partent της Ρωσίας
			if topos[toposid].parent ~= '' and topos[toposid].parent ~= nil then
				text = text .. ' « [[:Κατηγορία:' .. topos[toposid].parent .. ' ' 
				.. 'της Ρωσίας|' 
				.. topos[toposid].parent .. ' της Ρωσίας]]'
			end	
			
			text = text 
			.. '<dl><dd>Δείτε [[:Κατηγορία:' .. topos[toposid].word_cat .. ' της Ρωσίας στην Ευρώπη]] ή  [[:Κατηγορία:' .. topos[toposid].word_cat .. ' της Ρωσίας στην Ασία]]</dd></dl>'
			end
			
			-- cat a -- Russia has NO parent (would be Eurasia)
			if mw.ustring.find(cat_title, 'Τοπωνύμια') then
				 cat = "[[Κατηγορία:Τοπωνύμια ανά τόπο|'ρωσια]]" ..  "\n" -- sort apostroph			
			else			
				cat =  '[[Κατηγορία:' .. topos[toposid].word_cat .. " ανά τόπο|'ρωσια]]" ..  "\n" -- sort apostroph
				.. '[[Κατηγορία:Τοπωνύμια της Ρωσίας| ' .. topos[toposid].key .. ']]' ..  "\n"  -- sort top
			end
-- ?? HOW do I write where_text		
			if topos[toposid].parent ~= '' and topos[toposid].parent ~= nil then
				cat = cat .. '[[Κατηγορία:' .. topos[toposid].parent .. ' ' 
				.. 'της Ρωσίας| ]]' ..  "\n" -- sort top
			end
			
-- b mode -- [[:Κατηγορία:Τοπωνύμια της Ρωσίας (νέα ελληνικά)]]	
		else
			text = text_lang .. ' » [[:Κατηγορία:Θεματικές κατηγορίες (' .. lang_name .. ')|Θεματικές κατηγορίες]]' 
			.. ' » [[:Κατηγορία:Ονομασίες (' .. lang_name .. ')|Ονομασίες]]'
			.. ' » [[:Κατηγορία:Τοπωνύμια (' .. lang_name .. ')|<b>Τοπωνύμια</b> » ανά είδος]]'
			if mw.ustring.find(cat_title, 'Τοπωνύμια') then 
			text = text .. '<dl><dd>Δείτε [[:Κατηγορία:Τοπωνύμια της Ρωσίας στην Ευρώπη (' .. lang_name .. ')]] ή  [[:Κατηγορία:Τοπωνύμια της Ρωσίας στην Ασία (' .. lang_name .. ')]]</dd></dl>'
			
			else -- by place
			text = text .. ' :: [[:Κατηγορία:' .. topos[toposid].word_cat .. ' ανά τόπο (' .. lang_name .. ')|ανά τόπο]]' 
-- ?? HOW do I write where_text		
			-- it will write nothing for no parent categories like Αεροδρόμια
			-- it should write Κατηγορία:Θαλάσσιες περιοχές της Ρωσίας (νέα ελληνικά) for [[:Κατηγορία:Θάλασσες της Ρωσίας (νέα ελληνικά)]]
			if topos[toposid].parent ~= '' and topos[toposid].parent ~= nil then
				text = text .. ' « [[:Κατηγορία:' .. topos[toposid].parent .. ' ' 
				.. 'της Ρωσίας (' .. lang_name .. ')|' 
				.. topos[toposid].parent .. ' της Ρωσίας]]'
				.. '  [[:Κατηγορία:' .. topos[toposid].parent .. ' της Ρωσίας|«««]]'
			end	
			
			text = text
			.. '<dl><dd>Δείτε [[:Κατηγορία:' .. topos[toposid].word_cat .. ' της Ρωσίας στην Ευρώπη (' .. lang_name .. ')]] ή  [[:Κατηγορία:' .. topos[toposid].word_cat .. ' της Ρωσίας στην Ασία (' .. lang_name .. ')]]</dd></dl>'
			end
			
			-- cat b
			cat = '[[Κατηγορία:' .. topos[toposid].word_cat .. ' ανά τόπο (' .. lang_name .. ')|ρωσια]]' ..  "\n"
			if mw.ustring.find(cat_title, 'Τοπωνύμια') then
				 cat = '[[Κατηγορία:Τοπωνύμια της Ρωσίας|' .. languages[lang_iso].key .. ']]' ..  "\n"
				.. '[[Κατηγορία:Τοπωνύμια ανά τόπο (' .. lang_name .. ')|ρωσια]]' ..  "\n"
			else
				 cat = '[[Κατηγορία:' .. topos[toposid].word_cat .. ' της Ρωσίας|' .. languages[lang_iso].key .. ']]' ..  "\n"
				 .. '[[Κατηγορία:' .. topos[toposid].word_cat .. ' ανά τόπο (' .. lang_name ..')| ρωσια]]' ..  "\n" -- sort top
				 .. '[[Κατηγορία:Τοπωνύμια της Ρωσίας (' .. lang_name .. ')| ρωσια]]' ..  "\n" -- sort top
			end
-- ?? HOW do I write where_text		
			if topos[toposid].parent ~= '' and topos[toposid].parent ~= nil then
				cat = cat .. '[[Κατηγορία:' .. topos[toposid].parent .. ' ' 
				.. 'της Ρωσίας (' .. lang_name .. ')| ]]' ..  "\n" -- sort top
			end		
		end -- close parenthesis


else -- NOT RUSSIA

if mw.ustring.find(cat_title, ' της ') --and not mw.ustring.find(cat_title, ' της Ρωσίας')
	and not mw.ustring.find(cat_title, ' της εβδομάδας') and not mw.ustring.find(cat_title, ' της καθαρεύουσας') 
	and not mw.ustring.find(cat_title, 'Ποικιλίες της') and not mw.ustring.find(cat_title, 'Διάλεκτοι της') 
	and not mw.ustring.find(cat_title, 'Διαλεκτικά της') and not mw.ustring.find(cat_title, 'Διάλεκτοι της')  
	and not mw.ustring.find(cat_title, 'Γερμανικά της Πενσυλβανίας') and not mw.ustring.find(cat_title, 'Φιλιππινέζικα της κεντρικής Μπικόλ')
	and not mw.ustring.find(cat_title, 'παλαιά τουρκικά της Ανατολίας') and not mw.ustring.find(cat_title, 'της Ανατολίας')
	then
	toposwhere_label = get_topos_wherelabel(toposwhere_label)
	whereid = require("Module:topos/functions").catword_to_firstwhere(get_where_text(where_text))
	toposid = get_toposkind_id(toposwhere_label)
--	cat_title = get_topos_wherelabel(toposwhere_label) .. ' ' .. get_where_text(where_text)
-- mode a
		if cat_parenthesis == '' or cat_parenthesis == nil then
			text = text_wikt .. ' » [[:Κατηγορία:Θεματικές κατηγορίες|Θεματικές κατηγορίες]]' 
			.. ' » [[:Κατηγορία:Ονομασίες|Ονομασίες]]' 
			.. ' » [[:Κατηγορία:Τοπωνύμια|<b>Τοπωνύμια</b>]]' 
			.. ' » [[:Κατηγορία:Τοπωνύμια ανά είδος|ανά είδος]]' 
			if mw.ustring.find(cat_title, 'Τοπωνύμια') then 
				text = text   -- no repetition. Check [[:Κατηγορία:Αεροδρόμια της Ελλάδας]] -- [[:Κατηγορία:Τοπωνύμια της Ελλάδας]]
			else
				if topos[toposid].parent2 ~= '' and topos[toposid].parent2 ~= nil then  -- [[:Κατηγορία:Αρχαίοι ναοί της Ελλάδας]]
				text = text .. ' » [[:Κατηγορία:' .. topos[toposid].parent2 .. '|' .. topos[toposid].parent2 .. ']]'
				end
				if topos[toposid].parent ~= '' and topos[toposid].parent ~= nil then
				text = text .. ' » [[:Κατηγορία:' .. topos[toposid].parent .. '|' .. topos[toposid].parent .. ']]'
				end
				text = text .. ' » [[:Κατηγορία:' .. topos[toposid].word_cat .. '|' .. topos[toposid].word_cat .. ']]' 
			end
			-- by place
			text = text .. ' :: [[:Κατηγορία:' .. topos[toposid].word_cat .. ' ανά τόπο|ανά τόπο]]' 
			if where[whereid].parent4 ~= '' and where[whereid].parent4 ~= nil then
				text = text .. ' » [[:Κατηγορία:' .. topos[toposid].word_cat .. ' ' .. where[whereid].parent4 .. '|' .. where[whereid].parent4 .. ']]'
			end
			if where[whereid].parent3 ~= '' and where[whereid].parent3 ~= nil then
				text = text .. ' » [[:Κατηγορία:' .. topos[toposid].word_cat .. ' ' .. where[whereid].parent3 .. '|' .. where[whereid].parent3 .. ']]'
			end	
			if where[whereid].parent2 ~= '' and where[whereid].parent2 ~= nil then -- [[:Κατηγορία:Αεροδρόμια της Αγγλίας]]
				text = text .. ' » [[:Κατηγορία:' .. topos[toposid].word_cat .. ' ' .. where[whereid].parent2 .. '|' .. where[whereid].parent2 .. ']]'
			end	
			if where[whereid].parent ~= '' and where[whereid].parent ~= nil then
				text = text .. ' » [[:Κατηγορία:' .. topos[toposid].word_cat .. ' ' .. where[whereid].parent .. '|' .. where[whereid].parent .. ']]'
			end	
			text = text .. ' » [[:Κατηγορία:' .. cat_title .. '|' .. where[whereid].word_cat .. ']]' 
			if where[whereid].extra1 ~= '' and where[whereid].extra1 ~= nil then -- Θεματική -- [[:Κατηγορία:Δήμοι της αρχαίας Αθήνας]]
				text = text .. ' « [[:Κατηγορία:' .. topos[toposid].word_cat .. ' ' .. where[whereid].extra1 .. '|' .. where[whereid].extra1 .. ']]'
			end
			if where[whereid].extra2 ~= '' and where[whereid].extra2 ~= nil then
				text = text .. ' « [[:Κατηγορία:' .. topos[toposid].word_cat .. ' ' .. where[whereid].extra2 .. '|' .. where[whereid].extra2 .. ']]'
			end
			if where[whereid].extra3 ~= '' and where[whereid].extra3 ~= nil then
				text = text .. ' « [[:Κατηγορία:' .. topos[toposid].word_cat .. ' ' .. where[whereid].extra3 .. '|' .. where[whereid].extra3 .. ']]'
			end
-- ?? HOW do I write where_text		
			-- it will write nothing for no parent categories like Αεροδρόμια
			-- it should write Κατηγορία:Ναοί της Ελλάδας for the Subcateogry [[:Κατηγορία:Αρχαίοι ναοί της Ελλάδας]]
			if topos[toposid].parent ~= '' and topos[toposid].parent ~= nil then
				text = text .. ' « [[:Κατηγορία:' .. topos[toposid].parent .. ' ' 
				.. 'της ' .. mw.ustring.sub(mw.ustring.match(cat_title, " της (.*)"), 1, -1) .. '|' 
				.. topos[toposid].parent .. ' της ' .. mw.ustring.sub(mw.ustring.match(cat_title, " της (.*)"), 1, -1) .. ']]'
			end
			
			-- descr -- [[:Κατηγορία:Διαμερίσματα της Ελλάδας]] ------------------- toposwhere_label = topos[toposid]  
			if topos[toposid].descr ~= '' and topos[toposid].descr ~= nil then
				text_plus = '<dl><dd>' .. topos[toposid].descr .. '</dd></dl>'
			end	
			if where[whereid].word_cat == 'της Ρωσίας στην Ευρώπη' or where[whereid].word_cat == 'της Ρωσίας στην Ασία' then
				text = text .. '<dl><dd>Δείτε και την [[:Κατηγορία:' .. topos[toposid].word_cat .. ' της Ρωσίας]]</dd></dl>'
			end
-- see comment DIVISIONS above	
			-- cat a -- parent ALWAYS, except continents. parent may COINCIDE with a continent category, that 's ok.
			if where[whereid].parent ~= '' and where[whereid].parent ~= nil then
				cat = cat .. '[[Κατηγορία:' .. topos[toposid].word_cat .. ' ' .. where[whereid].parent .. "|'" .. where[whereid].key .. ']]' ..  "\n" -- sort apostroph
				if args['division'] == '1' or args['περιφέρεια'] == '1' then
				cat = cat
				else		
				cat = cat .. '[[Κατηγορία:' .. topos[toposid].word_cat .. " ανά τόπο|'" .. where[whereid].key .. ']]' ..  "\n"
				end
			end	
			-- [[:Κατηγορία:Τοπωνύμια της Ευρώπης]]
			if mw.ustring.find(cat_title, 'Τοπωνύμια') then -- [[:Κατηγορία:Τοπωνύμια της Ευρώπης]] 
				if mw.ustring.find(cat_title, 'Αμερικής') or mw.ustring.find(cat_title, 'Ανταρκτικ') or mw.ustring.find(cat_title, 'Ασίας')
				 or mw.ustring.find(cat_title, 'Αφρικής') or mw.ustring.find(cat_title, 'Ευρώπης') or mw.ustring.find(cat_title, 'Ωκεανίας')
				 or mw.ustring.find(cat_title, 'Αρκτικού') or mw.ustring.find(cat_title, 'Ατλαντικού')
				 or mw.ustring.find(cat_title, 'Ειρηνικού') or mw.ustring.find(cat_title, 'Ινδικού') or mw.ustring.find(cat_title, 'Σύμπαντος')
				 and not mw.ustring.find(cat_title, 'παλαιά τουρκικά της Ανατολίας')
				 then
				 cat = '[[Κατηγορία:Τοπωνύμια ανά τόπο| ' .. where[whereid].key .. ']]' ..  "\n" -- sort top
			-- [[:Κατηγορία:Τοπωνύμια της Ελλάδας]]
				else cat = cat
				end
			-- [[:Κατηγορία:Αεροδρόμια της Ευρώπης]]
			elseif mw.ustring.find(cat_title, 'Αμερικής') or mw.ustring.find(cat_title, 'Ανταρκτικ') or mw.ustring.find(cat_title, 'Ασίας')
				 or mw.ustring.find(cat_title, 'Αφρικής') or mw.ustring.find(cat_title, 'Ευρώπης') or mw.ustring.find(cat_title, 'Ωκεανίας')
				 or mw.ustring.find(cat_title, 'Αρκτικού') or mw.ustring.find(cat_title, 'Ατλαντικού')
				 or mw.ustring.find(cat_title, 'Ειρηνικού') or mw.ustring.find(cat_title, 'Ινδικού') or mw.ustring.find(cat_title, 'Σύμπαντος') then
				cat = cat .. '[[Κατηγορία:' .. topos[toposid].word_cat .. ' ανά τόπο| ' .. where[whereid].key .. ']]' ..  "\n" -- sort top	
				.. '[[Κατηγορία:Τοπωνύμια ' .. where[whereid].word_cat .. '| ' .. topos[toposid].key .. ']]' ..  "\n" -- sort top
--				.. '[[Κατηγορία:Τοπωνύμια ανά τόπο| ' .. where[whereid].key .. ']]' ..  "\n" -- sort top -- no, too many
-- ?? HOW do I write where_text	[[:Κατηγορία:Αρχαίοι ναοί της Ευρώπης]]
			if topos[toposid].parent ~= '' and topos[toposid].parent ~= nil then
				cat = cat .. '[[Κατηγορία:' .. topos[toposid].parent .. ' ' 
				.. 'της ' .. mw.ustring.sub(mw.ustring.match(cat_title, " της (.*)"), 1, -1) .. '| ]]' ..  "\n" -- sort top
			end

			 -- [[:Κατηγορία:Αεροδρόμια της Ελλάδας]]
			else
				cat = cat .. '[[Κατηγορία:' .. topos[toposid].word_cat .. ' ' ..  where[whereid].parent .. "|'" .. where[whereid].key .. ']]' ..  "\n" -- sort apostroph
				.. '[[Κατηγορία:Τοπωνύμια ' .. where[whereid].word_cat .. '| ' .. topos[toposid].key .. ']]' ..  "\n"  -- sort top
				 end
-- ?? HOW do I write where_text	[[:Κατηγορία:Αρχαίοι ναοί της Ελλάδας]]
			if topos[toposid].parent ~= '' and topos[toposid].parent ~= nil then
				cat = cat .. '[[Κατηγορία:' .. topos[toposid].parent .. ' ' 
				.. 'της ' .. mw.ustring.sub(mw.ustring.match(cat_title, " της (.*)"), 1, -1) .. '| ]]' ..  "\n" -- sort top
			end			 
				 
			if where[whereid].extra1 ~= '' and where[whereid].extra1 ~= nil then
				cat = cat .. '[[Κατηγορία:'  .. topos[toposid].word_cat .. ' ' .. where[whereid].extra1 .. '| ' .. topos[toposid].key .. ']]' ..  "\n" -- sort top
			end
			if where[whereid].extra2 ~= '' and where[whereid].extra2 ~= nil then
				cat = cat .. '[[Κατηγορία:'  .. topos[toposid].word_cat .. ' ' .. where[whereid].extra2 .. '| ' .. topos[toposid].key .. ']]' ..  "\n" -- sort top
			end
			if where[whereid].extra3 ~= '' and where[whereid].extra3 ~= nil then
				cat = cat .. '[[Κατηγορία:'  .. topos[toposid].word_cat .. ' ' .. where[whereid].extra3 .. '| ' .. topos[toposid].key .. ']]' ..  "\n" -- sort top
			end
			
-- b mode -- [[:Κατηγορία:Τοπωνύμια της Ελλάδας (νέα ελληνικά)]] =  Τοπωνύμια ανά είδος (γλώσσα)		
		else
			text = text_lang .. ' » [[:Κατηγορία:Θεματικές κατηγορίες (' .. lang_name .. ')|Θεματικές κατηγορίες]]' 
			.. ' » [[:Κατηγορία:Ονομασίες (' .. lang_name .. ')|Ονομασίες]]'
			.. ' » [[:Κατηγορία:Τοπωνύμια (' .. lang_name .. ')|<b>Τοπωνύμια</b> » ανά είδος]]'  -- Places + places by kind coincide when +language
			if mw.ustring.find(cat_title, 'Τοπωνύμια') then 
				text = text  -- no repetition. Check [[:Κατηγορία:Αεροδρόμια της Ελλάδας (νέα ελληνικά)]] -- [[:Κατηγορία:Τοπωνύμια της Ελλάδας (νέα ελληνικά)]]
			else
				if topos[toposid].parent2 ~= '' and topos[toposid].parent2 ~= nil then  -- [[:Κατηγορία:Αρχαίοι ναοί της Ελλάδας (νέα ελληνικά)]]
				text = text .. ' » [[:Κατηγορία:' .. topos[toposid].parent2 .. ' (' .. lang_name .. ')|' .. topos[toposid].parent2 .. ']]'
				end
				if topos[toposid].parent ~= '' and topos[toposid].parent ~= nil then
				text = text .. ' » [[:Κατηγορία:' .. topos[toposid].parent .. ' (' .. lang_name .. ')|' .. topos[toposid].parent .. ']]'
				end
				text = text .. ' » [[:Κατηγορία:' .. topos[toposid].word_cat .. ' (' .. lang_name .. ')|' .. topos[toposid].word_cat .. ']]' 
			end
			-- by place+lang
			text = text .. ' :: [[:Κατηγορία:' .. topos[toposid].word_cat .. ' ανά τόπο (' .. lang_name .. ')|ανά τόπο]]' 			
			if where[whereid].parent4 ~= '' and where[whereid].parent4 ~= nil then
				text = text .. ' » [[:Κατηγορία:' .. topos[toposid].word_cat .. ' ' .. where[whereid].parent4 .. ' (' .. lang_name .. ')|' .. where[whereid].parent4 .. ']]'
			end	
			if where[whereid].parent3 ~= '' and where[whereid].parent3 ~= nil then
				text = text .. ' » [[:Κατηγορία:' .. topos[toposid].word_cat .. ' ' .. where[whereid].parent3 .. ' (' .. lang_name .. ')|' .. where[whereid].parent3 .. ']]'
			end	
			if where[whereid].parent2 ~= '' and where[whereid].parent2 ~= nil then
				text = text .. ' » [[:Κατηγορία:' .. topos[toposid].word_cat .. ' ' .. where[whereid].parent2 .. ' (' .. lang_name .. ')|' .. where[whereid].parent2 .. ']]'
			end	
			if where[whereid].parent ~= '' and where[whereid].parent ~= nil then
				text = text .. ' » [[:Κατηγορία:' .. topos[toposid].word_cat .. ' ' .. where[whereid].parent .. ' (' .. lang_name .. ')|' .. where[whereid].parent .. ']]'
			end	
			text = text .. ' » [[:Κατηγορία:' .. cat_title .. ' (' .. lang_name .. ')|' .. where[whereid].word_cat .. ']]' 
			.. ' [[:Κατηγορία:' .. topos[toposid].word_cat .. ' ' .. where[whereid].word_cat .. '|«««]]'
			-- [[:Κατηγορία:Κάστρα της Βοιωτίας (ελληνιστική κοινή)]]
			if languages[lang_iso].sublang == true then
			text = text .. ' [[:Κατηγορία:' .. cat_title .. ' (' .. languages[lang_iso].host_name .. ')|«' .. languages[lang_iso].host_name .. ']]'
			end	
			if where[whereid].extra1 ~= '' and where[whereid].extra1 ~= nil then -- Θεματική -- [[:Κατηγορία:Δήμοι της αρχαίας Αθήνας (νέα ελληνικά)]]
				text = text .. ' « [[:Κατηγορία:' .. topos[toposid].word_cat .. ' ' .. where[whereid].extra1 .. ' (' .. lang_name .. ')|' .. where[whereid].extra1 .. ']]'
			end
-- ?? HOW do I write where_text		
			-- it will write nothing for no parent categories like Αεροδρόμια
			-- it should write Κατηγορία:Ναοί της Ελλάδας (νέα ελληνικά) for the Subcateogry [[:Κατηγορία:Αρχαίοι ναοί της Ελλάδας (νέα ελληνικά)]]
			if topos[toposid].parent ~= '' and topos[toposid].parent ~= nil then
				text = text 
				.. ' « [[:Κατηγορία:' .. topos[toposid].parent .. ' ' 
				.. 'της ' .. mw.ustring.sub(mw.ustring.match(cat_title, " της (.*)"), 1, -1)  .. ' (' .. lang_name .. ')|' 
				.. topos[toposid].parent .. ' της ' .. mw.ustring.sub(mw.ustring.match(cat_title, " της (.*)"), 1, -1) .. ']]'
			end			
			
			-- descr
			if topos[toposid].descr ~= '' and topos[toposid].descr ~= nil then
				text_plus = '<dl><dd>' .. topos[toposid].descr .. '</dd></dl>'
			end	
			if where[whereid].word_cat == 'της Ρωσίας στην Ευρώπη' or where[whereid].word_cat == 'της Ρωσίας στην Ασία' then
				text = text .. '<dl><dd>Δείτε και την [[:Κατηγορία:' .. topos[toposid].word_cat .. ' της Ρωσίας (' .. lang_name .. ')]]</dd></dl>'
			end			
			
			
			
			-- cat b  -- parent ALWAYS, except continents. parent may COINCIDE with a continent category, that 's ok.
			-- [[:Κατηγορία:Τοπωνύμια της Ελλάδας (νέα ελληνικά)]] -- [[:Κατηγορία:Τοπωνύμια της Ευρώπης (νέα ελληνικά)]] -- [[:Κατηγορία:Αεροδρόμια της Ελλάδας (νέα ελληνικά)]]
			cat = '[[Κατηγορία:' .. topos[toposid].word_cat .. ' ανά τόπο (' .. lang_name .. ")|" .. where[whereid].key .. ']]' ..  "\n"
			if mw.ustring.find(cat_title, 'Τοπωνύμια') then -- [[:Κατηγορία:Τοπωνύμια της Ευρώπης (νέα ελληνικά)]] 
				if mw.ustring.find(cat_title, 'Αμερικής') or mw.ustring.find(cat_title, 'Ανταρκτικ') or mw.ustring.find(cat_title, 'Ασίας')
				 or mw.ustring.find(cat_title, 'Αφρικής') or mw.ustring.find(cat_title, 'Ευρώπης') or mw.ustring.find(cat_title, 'Ωκεανίας')
				 or mw.ustring.find(cat_title, 'Αρκτικού') or mw.ustring.find(cat_title, 'Ατλαντικού')
				 or mw.ustring.find(cat_title, 'Ειρηνικού') or mw.ustring.find(cat_title, 'Ινδικού') or mw.ustring.find(cat_title, 'Σύμπαντος') then
				 cat = '[[Κατηγορία:Τοπωνύμια ' ..  where[whereid].word_cat  .. '|' .. languages[lang_iso].key .. ']]' ..  "\n"
				 .. '[[Κατηγορία:Τοπωνύμια ανά τόπο (' .. lang_name .. ')| ' .. where[whereid].key .. ']]' ..  "\n" -- sort top
				else  -- [[:Κατηγορία:Τοπωνύμια της Ελλάδας (νέα ελληνικά)]]
					cat = '[[Κατηγορία:Τοπωνύμια ' ..  where[whereid].word_cat  .. '|' .. languages[lang_iso].key .. ']]' ..  "\n"
					.. '[[Κατηγορία:Τοπωνύμια ανά τόπο (' .. lang_name .. ')|' .. where[whereid].key .. ']]' ..  "\n"
				end
			elseif mw.ustring.find(cat_title, 'Αμερικής') or mw.ustring.find(cat_title, 'Ανταρκτικ') or mw.ustring.find(cat_title, 'Ασίας')
				 or mw.ustring.find(cat_title, 'Αφρικής') or mw.ustring.find(cat_title, 'Ευρώπης') or mw.ustring.find(cat_title, 'Ωκεανίας')
				 or mw.ustring.find(cat_title, 'Αρκτικού') or mw.ustring.find(cat_title, 'Ατλαντικού')
				 or mw.ustring.find(cat_title, 'Ειρηνικού') or mw.ustring.find(cat_title, 'Ινδικού') or mw.ustring.find(cat_title, 'Σύμπαντος') then -- [[:Κατηγορία:Αεροδρόμια της Ευρώπης (νέα ελληνικά)]]
				 cat = '[[Κατηγορία:' .. topos[toposid].word_cat .. ' ' .. where[whereid].word_cat .. '|' .. languages[lang_iso].key .. ']]' ..  "\n"
				 .. '[[Κατηγορία:' .. topos[toposid].word_cat .. ' ανά τόπο (' .. lang_name ..')| ' .. where[whereid].key .. ']]' ..  "\n" -- sort top
				 .. '[[Κατηγορία:Τοπωνύμια ' .. where[whereid].word_cat .. ' (' .. lang_name .. ')| ' .. where[whereid].key .. ']]' ..  "\n" -- sort top
-- ?? HOW do I write where_text		
			if topos[toposid].parent ~= '' and topos[toposid].parent ~= nil then
				cat = cat .. '[[Κατηγορία:' .. topos[toposid].parent .. ' ' 
				.. 'της ' .. mw.ustring.sub(mw.ustring.match(cat_title, " της (.*)"), 1, -1)  .. ' (' .. lang_name .. ')| ]]' ..  "\n" -- sort top
			end		 
				 
			else -- [[:Κατηγορία:Αεροδρόμια της Ελλάδας (νέα ελληνικά)]]
				cat = cat .. '[[Κατηγορία:' .. topos[toposid].word_cat .. ' ' .. where[whereid].word_cat .. '|' .. languages[lang_iso].key .. ']]' ..  "\n"
			end
			if where[whereid].parent ~= '' and where[whereid].parent ~= nil then
				cat = cat .. '[[Κατηγορία:' .. topos[toposid].word_cat .. ' ' .. where[whereid].parent .. ' (' .. lang_name .. ")|'" .. where[whereid].key .. ']]' ..  "\n" -- sort apostroph
			end	
-- ?? HOW do I write where_text		
			if topos[toposid].parent ~= '' and topos[toposid].parent ~= nil then
				cat = cat .. '[[Κατηγορία:' .. topos[toposid].parent .. ' ' 
				.. 'της ' .. mw.ustring.sub(mw.ustring.match(cat_title, " της (.*)"), 1, -1)  .. ' (' .. lang_name .. ')| ]]' ..  "\n" -- sort top
			end	
			if languages[lang_iso].sublang == true then
			cat = cat .. '[[Κατηγορία:' .. cat_title .. ' (' .. languages[lang_iso].host_name ..  ')|' .. languages[lang_iso].host_key .. ']]' .. "\n"
			end		
			-- extras
			if where[whereid].extra1 ~= '' and where[whereid].extra1 ~= nil then
				cat = cat .. '[[Κατηγορία:'  .. topos[toposid].word_cat .. ' ' .. where[whereid].extra1 .. ' (' .. lang_name .. ')| ' .. topos[toposid].key .. ']]' ..  "\n" -- sort top
			end
			if where[whereid].extra2 ~= '' and where[whereid].extra2 ~= nil then
				cat = cat .. '[[Κατηγορία:'  .. topos[toposid].word_cat .. ' ' .. where[whereid].extra2 .. ' (' .. lang_name .. ')| ' .. topos[toposid].key .. ']]' ..  "\n" -- sort top
			end
			if where[whereid].extra3 ~= '' and where[whereid].extra3 ~= nil then
				cat = cat .. '[[Κατηγορία:'  ..topos[toposid].word_cat .. ' ' ..  where[whereid].extra3 .. ' (' .. lang_name .. ')| ' .. topos[toposid].key .. ']]' ..  "\n" -- sort top
			end
			
		end -- close parenthesis
	
end -- close if της and not, and not
end -- close Russia

-- ========================== του...  [[:Κατηγορία:Πόλεις του Καναδά]]-- [[:Κατηγορία:Πόλεις του Καναδά (γαλλικά)]]
function get_where_text2(where_text2)
	if mw.ustring.find(cat_title, ' του ') 
	and not mw.ustring.find(cat_title, ' του Βικιλεξικού') and not mw.ustring.find(cat_title, ' μέρη του λόγου') 
	and not mw.ustring.find(cat_title, 'Γερμανικά του Παλατινάτου') and not mw.ustring.find(cat_title, 'γερμανικά του Παλατινάτου') 
	and not mw.ustring.find(cat_title, 'Διαλεκτικά του') and not mw.ustring.find(cat_title, 'μάγια του Γιουκατάν')  
	and not mw.ustring.find(cat_title, 'από το λεξικό του') and not mw.ustring.find(cat_title, 'του ποντιακού ελληνισμού')
	and not mw.ustring.find(cat_title, 'του αττικού ημερολογίου') and not mw.ustring.find(cat_title, 'του μακεδονικού ημερολογίου')
	and not mw.ustring.find(cat_title, 'του σώματος') and not mw.ustring.find(cat_title, 'του συστήματος')
	and not mw.ustring.find(cat_title, 'τύπος του')
	then
		where_text2 = 'του ' .. mw.ustring.sub(mw.ustring.match(cat_title, " του (.*)"), 1, -1)
	end
return where_text2
end

function get_where2(whereid2)
	whereid2 = require("Module:topos/functions").catword_to_firstwhere(get_where_text2(where_text2))
return whereid2
end

function get_topos_wherelabel2(toposwhere_label2)
	length = mw.ustring.len(get_where_text2(where_text2))
	toposwhere_label2 = mw.ustring.sub(cat_title, 1, -length-1) -- length gives me: Label τ  So, i substract one more.
return toposwhere_label2
end

function get_toposkind_id(toposid)
	if mw.ustring.find(cat_title, toposwhere_label2) then
	toposid = get_toposid(toposwhere_label2)
	end
return toposid
end


-- ---------------------- application του CHECK [[:Κατηγορία:Τοπωνύμια του Καναδά]]
if mw.ustring.find(cat_title, ' του ') 
	and not mw.ustring.find(cat_title, ' του Βικιλεξικού') and not mw.ustring.find(cat_title, ' μέρη του λόγου') 
	and not mw.ustring.find(cat_title, 'Γερμανικά του Παλατινάτου') and not mw.ustring.find(cat_title, 'γερμανικά του Παλατινάτου') 
	and not mw.ustring.find(cat_title, 'Διαλεκτικά του') and not mw.ustring.find(cat_title, 'μάγια του Γιουκατάν')  
	and not mw.ustring.find(cat_title, 'από το λεξικό του') and not mw.ustring.find(cat_title, 'του ποντιακού ελληνισμού')
	and not mw.ustring.find(cat_title, 'του αττικού ημερολογίου') and not mw.ustring.find(cat_title, 'του μακεδονικού ημερολογίου')
	and not mw.ustring.find(cat_title, 'του σώματος') and not mw.ustring.find(cat_title, 'του συστήματος') and not mw.ustring.find(cat_title, 'από τα έργα')
	and not mw.ustring.find(cat_title, 'τύπος του')
	then
	toposwhere_label2 = get_topos_wherelabel2(toposwhere_label2)
	whereid2 = require("Module:topos/functions").catword_to_firstwhere(get_where_text2(where_text2))
	toposid = get_toposkind_id(toposwhere_label2)
--	cat_title = get_topos_wherelabel2(toposwhere_label2) .. ' ' .. get_where_text2(where_text2)
-- mode a
		if cat_parenthesis == '' or cat_parenthesis == nil then
			text = text_wikt .. ' » [[:Κατηγορία:Θεματικές κατηγορίες|Θεματικές κατηγορίες]]' 
			.. ' » [[:Κατηγορία:Ονομασίες|Ονομασίες]]' 
			.. ' » [[:Κατηγορία:Τοπωνύμια|<b>Τοπωνύμια</b>]]' 
			.. ' » [[:Κατηγορία:Τοπωνύμια ανά είδος|ανά είδος]]' 
			if mw.ustring.find(cat_title, 'Τοπωνύμια') then 
				text = text   -- no repetition. Check [[:Κατηγορία:Αεροδρόμια του Καναδά]] -- [[:Κατηγορία:Τοπωνύμια του Καναδά]]
			else
				if topos[toposid].parent2 ~= '' and topos[toposid].parent2 ~= nil then
				text = text .. ' » [[:Κατηγορία:' .. topos[toposid].parent2 .. '|' .. topos[toposid].parent2 .. ']]'
				end
				if topos[toposid].parent ~= '' and topos[toposid].parent ~= nil then
				text = text .. ' » [[:Κατηγορία:' .. topos[toposid].parent .. '|' .. topos[toposid].parent .. ']]'
				end
				text = text .. ' » [[:Κατηγορία:' .. topos[toposid].word_cat .. '|' .. topos[toposid].word_cat .. ']]' 
			end
			-- by place
			text = text .. ' :: [[:Κατηγορία:' .. topos[toposid].word_cat .. ' ανά τόπο|ανά τόπο]]' 
			if where[whereid2].parent4 ~= '' and where[whereid2].parent4 ~= nil then
				text = text .. ' » [[:Κατηγορία:' .. topos[toposid].word_cat .. ' ' .. where[whereid2].parent4 .. '|' .. where[whereid2].parent4 .. ']]'
			end
			if where[whereid2].parent3 ~= '' and where[whereid2].parent3 ~= nil then
				text = text .. ' » [[:Κατηγορία:' .. topos[toposid].word_cat .. ' ' .. where[whereid2].parent3 .. '|' .. where[whereid2].parent3 .. ']]'
			end	
			if where[whereid2].parent2 ~= '' and where[whereid2].parent2 ~= nil then
				text = text .. ' » [[:Κατηγορία:' .. topos[toposid].word_cat .. ' ' .. where[whereid2].parent2 .. '|' .. where[whereid2].parent2 .. ']]'
			end	
			if where[whereid2].parent ~= '' and where[whereid2].parent ~= nil then
				text = text .. ' » [[:Κατηγορία:' .. topos[toposid].word_cat .. ' ' .. where[whereid2].parent .. '|' .. where[whereid2].parent .. ']]'
			end	
			text = text .. ' » [[:Κατηγορία:' .. cat_title .. '|' .. where[whereid2].word_cat .. ']]' 
			if where[whereid2].extra1 ~= '' and where[whereid2].extra1 ~= nil then -- Θεματική
				text = text .. ' « [[:Κατηγορία:' .. topos[toposid].word_cat .. ' ' .. where[whereid2].extra1 .. '|' .. where[whereid2].extra1 .. ']]'
			end
			if where[whereid2].extra2 ~= '' and where[whereid2].extra2 ~= nil then
				text = text .. ' « [[:Κατηγορία:' .. topos[toposid].word_cat .. ' ' .. where[whereid2].extra2 .. '|' .. where[whereid2].extra2 .. ']]'
			end
			if where[whereid2].extra3 ~= '' and where[whereid2].extra3 ~= nil then
				text = text .. ' « [[:Κατηγορία:' .. topos[toposid].word_cat .. ' ' .. where[whereid2].extra3 .. '|' .. where[whereid2].extra3 .. ']]'
			end
-- ?? HOW do I write where_text		
			-- it will write nothing for no parent categories like Αεροδρόμια
			-- it should write Κατηγορία: partent του Καναδά
			if topos[toposid].parent ~= '' and topos[toposid].parent ~= nil then
				text = text .. ' « [[:Κατηγορία:' .. topos[toposid].parent .. ' ' 
				.. 'του ' .. mw.ustring.sub(mw.ustring.match(cat_title, " του (.*)"), 1, -1) .. '|' 
				.. topos[toposid].parent .. ' του ' .. mw.ustring.sub(mw.ustring.match(cat_title, " του (.*)"), 1, -1) .. ']]'
			end			
			
			-- descr --  ------------------- toposwhere_label2 = topos[toposid]  
			if topos[toposid].descr ~= '' and topos[toposid].descr ~= nil then
				text_plus = '<dl><dd>' .. topos[toposid].descr .. '</dd></dl>'
			end	
-- see comment DIVISIONS above	
			-- cat a -- parent ALWAYS, except continents. parent may COINCIDE with a continent category, that 's ok.		
			if where[whereid2].parent ~= '' and where[whereid2].parent ~= nil then
				cat = cat .. '[[Κατηγορία:' .. topos[toposid].word_cat .. ' ' .. where[whereid2].parent .. "|'" .. where[whereid2].key .. ']]' ..  "\n" -- sort apostroph
				if args['division'] == '1' or args['περιφέρεια'] == '1' then
				cat = cat
				else
				cat = cat .. '[[Κατηγορία:' .. topos[toposid].word_cat .. " ανά τόπο|'" .. where[whereid2].key .. ']]' ..  "\n"
				end
			end	
			-- [[:Κατηγορία:Τοπωνύμια του Ατλαντικού Ωκεανού]]
			if mw.ustring.find(cat_title, 'Τοπωνύμια') then
				if mw.ustring.find(cat_title, 'Αμερικής') or mw.ustring.find(cat_title, 'Ανταρκτικ') or mw.ustring.find(cat_title, 'Ασίας')
				 or mw.ustring.find(cat_title, 'Αφρικής') or mw.ustring.find(cat_title, 'Ευρώπης') or mw.ustring.find(cat_title, 'Ωκεανίας')
				 or mw.ustring.find(cat_title, 'Αρκτικού') or mw.ustring.find(cat_title, 'Ατλαντικού')
				 or mw.ustring.find(cat_title, 'Ειρηνικού') or mw.ustring.find(cat_title, 'Ινδικού') or mw.ustring.find(cat_title, 'Σύμπαντος') then
				 cat = '[[Κατηγορία:Τοπωνύμια ανά τόπο| ' .. where[whereid2].key .. ']]' ..  "\n" -- sort top
			-- [[:Κατηγορία:Τοπωνύμια του Καναδά]]
				else cat = cat
				end
			-- [[:Κατηγορία:Αρχιπέλαγα του Ατλαντικού Ωκεανού]]
			elseif mw.ustring.find(cat_title, 'Αμερικής') or mw.ustring.find(cat_title, 'Ανταρκτικ') or mw.ustring.find(cat_title, 'Ασίας')
				 or mw.ustring.find(cat_title, 'Αφρικής') or mw.ustring.find(cat_title, 'Ευρώπης') or mw.ustring.find(cat_title, 'Ωκεανίας')
				 or mw.ustring.find(cat_title, 'Αρκτικού') or mw.ustring.find(cat_title, 'Ατλαντικού')
				 or mw.ustring.find(cat_title, 'Ειρηνικού') or mw.ustring.find(cat_title, 'Ινδικού') or mw.ustring.find(cat_title, 'Σύμπαντος') then
				cat = cat .. '[[Κατηγορία:' .. topos[toposid].word_cat .. ' ανά τόπο| ' .. where[whereid2].key .. ']]' ..  "\n" -- sort top	
				.. '[[Κατηγορία:Τοπωνύμια ' .. where[whereid2].word_cat .. '| ' .. topos[toposid].key .. ']]' ..  "\n" -- sort top
--				.. '[[Κατηγορία:Τοπωνύμια ανά τόπο| ' .. where[whereid2].key .. ']]' ..  "\n" -- sort top -- no, too many
-- ?? HOW do I write where_text	[[:Κατηγορία:Αρχιπέλαγα του Ειρηνικού Ωκεανού]]	
			if topos[toposid].parent ~= '' and topos[toposid].parent ~= nil then
				cat = cat .. '[[Κατηγορία:' .. topos[toposid].parent .. ' ' 
				.. 'του ' .. mw.ustring.sub(mw.ustring.match(cat_title, " του (.*)"), 1, -1) .. '| ]]' ..  "\n" -- sort top
			end

			 -- [[:Κατηγορία:Πόλεις του Καναδά]]
			else
				cat = cat .. '[[Κατηγορία:' .. topos[toposid].word_cat .. ' ' ..  where[whereid2].parent .. "|'" .. where[whereid2].key .. ']]' ..  "\n" -- sort apostroph
				.. '[[Κατηγορία:Τοπωνύμια ' .. where[whereid2].word_cat .. '| ' .. topos[toposid].key .. ']]' ..  "\n"  -- sort top
				 end
-- ?? HOW do I write where_text		
			if topos[toposid].parent ~= '' and topos[toposid].parent ~= nil then
				cat = cat .. '[[Κατηγορία:' .. topos[toposid].parent .. ' ' 
				.. 'του ' .. mw.ustring.sub(mw.ustring.match(cat_title, " του (.*)"), 1, -1) .. '| ]]' ..  "\n" -- sort top
			end	 
				 
			-- no example (διπλή υπαγωγή, Ευρώπη + extra Ασία)
			if where[whereid2].extra1 ~= '' and where[whereid2].extra1 ~= nil then -- Θεματική
				cat = cat .. '[[Κατηγορία:'  .. topos[toposid].word_cat .. ' ' .. where[whereid2].extra1 .. '| ' .. topos[toposid].key .. ']]' ..  "\n" -- sort top
			end
			if where[whereid2].extra2 ~= '' and where[whereid2].extra2 ~= nil then -- Θεματική
				cat = cat .. '[[Κατηγορία:'  .. topos[toposid].word_cat .. ' ' .. where[whereid2].extra2 .. '| ' .. topos[toposid].key .. ']]' ..  "\n" -- sort top
			end
			if where[whereid2].extra3 ~= '' and where[whereid2].extra3 ~= nil then -- Θεματική
				cat = cat .. '[[Κατηγορία:'  .. topos[toposid].word_cat .. ' ' .. where[whereid2].extra3 .. '| ' .. topos[toposid].key .. ']]' ..  "\n" -- sort top
			end
			
-- b mode	
		else
			text = text_lang .. ' » [[:Κατηγορία:Θεματικές κατηγορίες (' .. lang_name .. ')|Θεματικές κατηγορίες]]' 
			.. ' » [[:Κατηγορία:Ονομασίες (' .. lang_name .. ')|Ονομασίες]]'
			.. ' » [[:Κατηγορία:Τοπωνύμια (' .. lang_name .. ')|<b>Τοπωνύμια</b> » ανά είδος]]'  -- Places + places by kind coincide when +language
			if mw.ustring.find(cat_title, 'Τοπωνύμια') then 
				text = text  -- no repetition. Check [[:Κατηγορία:Πόλεις του Καναδά (νέα ελληνικά)]] -- [[:Κατηγορία:Τοπωνύμια του Καναδά (νέα ελληνικά)]]
			else
				if topos[toposid].parent2 ~= '' and topos[toposid].parent2 ~= nil then
				text = text .. ' » [[:Κατηγορία:' .. topos[toposid].parent2 .. ' (' .. lang_name .. ')|' .. topos[toposid].parent2 .. ']]'
				end
				if topos[toposid].parent ~= '' and topos[toposid].parent ~= nil then
				text = text .. ' » [[:Κατηγορία:' .. topos[toposid].parent .. ' (' .. lang_name .. ')|' .. topos[toposid].parent .. ']]'
				end

				text = text .. ' » [[:Κατηγορία:' .. topos[toposid].word_cat .. ' (' .. lang_name .. ')|' .. topos[toposid].word_cat .. ']]' 
			end
			-- by place+lang
			text = text .. ' :: [[:Κατηγορία:' .. topos[toposid].word_cat .. ' ανά τόπο (' .. lang_name .. ')|ανά τόπο]]' 			
			if where[whereid2].parent4 ~= '' and where[whereid2].parent4 ~= nil then
				text = text .. ' » [[:Κατηγορία:' .. topos[toposid].word_cat .. ' ' .. where[whereid2].parent4 .. ' (' .. lang_name .. ')|' .. where[whereid2].parent4 .. ']]'
			end	
			if where[whereid2].parent3 ~= '' and where[whereid2].parent3 ~= nil then
				text = text .. ' » [[:Κατηγορία:' .. topos[toposid].word_cat .. ' ' .. where[whereid2].parent3 .. ' (' .. lang_name .. ')|' .. where[whereid2].parent3 .. ']]'
			end	
			if where[whereid2].parent2 ~= '' and where[whereid2].parent2 ~= nil then
				text = text .. ' » [[:Κατηγορία:' .. topos[toposid].word_cat .. ' ' .. where[whereid2].parent2 .. ' (' .. lang_name .. ')|' .. where[whereid2].parent2 .. ']]'
			end	
			if where[whereid2].parent ~= '' and where[whereid2].parent ~= nil then
				text = text .. ' » [[:Κατηγορία:' .. topos[toposid].word_cat .. ' ' .. where[whereid2].parent .. ' (' .. lang_name .. ')|' .. where[whereid2].parent .. ']]'
			end	
			text = text .. ' » [[:Κατηγορία:' .. cat_title .. ' (' .. lang_name .. ')|' .. where[whereid2].word_cat .. ']]'  -- [[:Κατηγορία:Τοπωνύμια του Καναδά (νέα ελληνικά)]]
			.. ' [[:Κατηγορία:' .. topos[toposid].word_cat .. ' ' .. where[whereid2].word_cat .. '|«««]]' -- [[:Κατηγορία:Τοπωνύμια του Καναδά]]
			if languages[lang_iso].sublang == true then
			text = text .. ' [[:Κατηγορία:' .. cat_title .. ' (' .. languages[lang_iso].host_name .. ')|«' .. languages[lang_iso].host_name .. ']]'
			end	
			if where[whereid2].extra1 ~= '' and where[whereid2].extra1 ~= nil then -- Θεματική
				text = text .. ' « [[:Κατηγορία:' .. topos[toposid].word_cat .. ' ' .. where[whereid2].extra1 .. ' (' .. lang_name .. ')|' .. where[whereid2].extra1 .. ']]'
			end
-- ?? HOW do I write where_text		
			-- it will write nothing for no parent categories like Αεροδρόμια
			-- it should write Κατηγορία: parent του Καναδά
			if topos[toposid].parent ~= '' and topos[toposid].parent ~= nil then
				text = text .. ' « [[:Κατηγορία:' .. topos[toposid].parent .. ' ' 
				.. 'του ' .. mw.ustring.sub(mw.ustring.match(cat_title, " του (.*)"), 1, -1)  .. ' (' .. lang_name .. ')|' 
				.. topos[toposid].parent .. ' του ' .. mw.ustring.sub(mw.ustring.match(cat_title, " του (.*)"), 1, -1) .. ']]'
			end			
			
			-- descr
			if topos[toposid].descr ~= '' and topos[toposid].descr ~= nil then
				text_plus = '<dl><dd>' .. topos[toposid].descr .. '</dd></dl>'
			end			
			
			-- cat b  -- parent ALWAYS, except continents. parent may COINCIDE with a continent category, that 's ok.
			-- [[:Κατηγορία:Τοπωνύμια του Καναδά (νέα ελληνικά)]] -- [[:Κατηγορία:Τοπωνύμια του Ατλαντικού (νέα ελληνικά)]] -- [[:Κατηγορία:Πόλεις του Καναδά (νέα ελληνικά)]]
			cat = '[[Κατηγορία:' .. topos[toposid].word_cat .. ' ανά τόπο (' .. lang_name .. ")|'" .. where[whereid2].key .. ']]' ..  "\n"
			if mw.ustring.find(cat_title, 'Τοπωνύμια') then -- [[:Κατηγορία:Τοπωνύμια της Ευρώπης (νέα ελληνικά)]] 
				if mw.ustring.find(cat_title, 'Αμερικής') or mw.ustring.find(cat_title, 'Ανταρκτικ') or mw.ustring.find(cat_title, 'Ασίας')
				 or mw.ustring.find(cat_title, 'Αφρικής') or mw.ustring.find(cat_title, 'Ευρώπης') or mw.ustring.find(cat_title, 'Ωκεανίας')
				 or mw.ustring.find(cat_title, 'Αρκτικού') or mw.ustring.find(cat_title, 'Ατλαντικού')
				 or mw.ustring.find(cat_title, 'Ειρηνικού') or mw.ustring.find(cat_title, 'Ινδικού') or mw.ustring.find(cat_title, 'Σύμπαντος') then
				 cat = '[[Κατηγορία:Τοπωνύμια ' ..  where[whereid2].word_cat  .. '|' .. languages[lang_iso].key .. ']]' ..  "\n"
				 .. '[[Κατηγορία:Τοπωνύμια ανά τόπο (' .. lang_name .. ')| ' .. where[whereid2].key .. ']]' ..  "\n" -- sort top
				else  -- [[:Κατηγορία:Τοπωνύμια του Καναδά (νέα ελληνικά)]]
					cat = '[[Κατηγορία:Τοπωνύμια ' ..  where[whereid2].word_cat  .. '|' .. languages[lang_iso].key .. ']]' ..  "\n"
					.. '[[Κατηγορία:Τοπωνύμια ανά τόπο (' .. lang_name .. ')|' .. where[whereid2].key .. ']]' ..  "\n"
				end
			elseif mw.ustring.find(cat_title, 'Αμερικής') or mw.ustring.find(cat_title, 'Ανταρκτικ') or mw.ustring.find(cat_title, 'Ασίας')
				 or mw.ustring.find(cat_title, 'Αφρικής') or mw.ustring.find(cat_title, 'Ευρώπης') or mw.ustring.find(cat_title, 'Ωκεανίας')
				 or mw.ustring.find(cat_title, 'Αρκτικού') or mw.ustring.find(cat_title, 'Ατλαντικού')
				 or mw.ustring.find(cat_title, 'Ειρηνικού') or mw.ustring.find(cat_title, 'Ινδικού') or mw.ustring.find(cat_title, 'Σύμπαντος') then
				 cat = '[[Κατηγορία:' .. topos[toposid].word_cat .. ' ' .. where[whereid2].word_cat .. '|' .. languages[lang_iso].key .. ']]' ..  "\n"
				 .. '[[Κατηγορία:' .. topos[toposid].word_cat .. ' ανά τόπο (' .. lang_name ..')| ' .. where[whereid2].key .. ']]' ..  "\n" -- sort top
				 .. '[[Κατηγορία:Τοπωνύμια ' .. where[whereid2].word_cat .. ' (' .. lang_name .. ')| ' .. where[whereid2].key .. ']]' ..  "\n" -- sort top
-- ?? HOW do I write where_text		
			if topos[toposid].parent ~= '' and topos[toposid].parent ~= nil then
				cat = cat .. '[[Κατηγορία:' .. topos[toposid].parent .. ' ' 
				.. 'του ' .. mw.ustring.sub(mw.ustring.match(cat_title, " του (.*)"), 1, -1)  .. ' (' .. lang_name .. ')| ]]' ..  "\n" -- sort top
			end				 
				 
			else -- [[:Κατηγορία:Πόλεις του Καναδά (νέα ελληνικά)]]
				cat = cat .. '[[Κατηγορία:' .. topos[toposid].word_cat .. ' ' .. where[whereid2].word_cat .. '|' .. languages[lang_iso].key .. ']]' ..  "\n"
				 end
-- ?? HOW do I write where_text		
			if topos[toposid].parent ~= '' and topos[toposid].parent ~= nil then
				cat = cat .. '[[Κατηγορία:' .. topos[toposid].parent .. ' ' 
				.. 'του ' .. mw.ustring.sub(mw.ustring.match(cat_title, " του (.*)"), 1, -1)  .. ' (' .. lang_name .. ')| ]]' ..  "\n" -- sort top
			end	
		
			if where[whereid2].parent ~= '' and where[whereid2].parent ~= nil then
				cat = cat .. '[[Κατηγορία:' .. topos[toposid].word_cat .. ' ' .. where[whereid2].parent .. ' (' .. lang_name .. ")|'" .. where[whereid2].key .. ']]' ..  "\n" -- sort apostroph
			end	
			if languages[lang_iso].sublang == true then
			cat = cat .. '[[Κατηγορία:' .. cat_title .. ' (' .. languages[lang_iso].host_name ..  ')|' .. languages[lang_iso].host_key .. ']]' .. "\n"
			end	
			-- extras  no example (διπλή υπαγωγή, Ευρώπη + extra Ασία)
			if where[whereid2].extra1 ~= '' and where[whereid2].extra1 ~= nil then
				cat = cat .. '[[Κατηγορία:'  .. topos[toposid].word_cat .. ' ' .. where[whereid2].extra1 .. ' (' .. lang_name .. ')| ' .. topos[toposid].key .. ']]' ..  "\n" -- sort top
			end
			if where[whereid2].extra2 ~= '' and where[whereid2].extra2 ~= nil then
				cat = cat .. '[[Κατηγορία:'  .. topos[toposid].word_cat .. ' ' .. where[whereid2].extra2 .. ' (' .. lang_name .. ')| ' .. topos[toposid].key .. ']]' ..  "\n" -- sort top
			end
			if where[whereid2].extra3 ~= '' and where[whereid2].extra3 ~= nil then
				cat = cat .. '[[Κατηγορία:'  ..topos[toposid].word_cat .. ' ' ..  where[whereid2].extra3 .. ' (' .. lang_name .. ')| ' .. topos[toposid].key .. ']]' ..  "\n" -- sort top
			end
			
		end -- close parenthesis
	
end -- close if του and not, and not



-- ========================== των...  [[:Κατηγορία:Πόλεις των ΗΠΑ]]-- [[:Κατηγορία:Πόλεις των ΗΠΑ (αγγλικά)]]
function get_where_text3(where_text3)
	if mw.ustring.find(cat_title, ' των ') 
	and not mw.ustring.find(cat_title, ' των αμινοξέων') and not mw.ustring.find(cat_title, ' των αστερισμών') 
	and not mw.ustring.find(cat_title, ' των ζωδίων')
	then
		where_text3 = 'των ' .. mw.ustring.sub(mw.ustring.match(cat_title, " των (.*)"), 1, -1)
	end
return where_text3
end

function get_where3(whereid3)
	whereid3 = require("Module:topos/functions").catword_to_firstwhere(get_where_text3(where_text3))
return whereid3
end

function get_topos_wherelabel3(toposwhere_label3)
	length = mw.ustring.len(get_where_text3(where_text3))
	toposwhere_label3 = mw.ustring.sub(cat_title, 1, -length-1) -- length gives me: Label τ  So, i substract one more.
return toposwhere_label3
end

function get_toposkind_id(toposid)
	if mw.ustring.find(cat_title, toposwhere_label3) then
	toposid = get_toposid(toposwhere_label3)
	end
return toposid
end


-- ---------------------- application των
if mw.ustring.find(cat_title, ' των ') 
	and not mw.ustring.find(cat_title, ' των αμινοξέων') and not mw.ustring.find(cat_title, ' των αστερισμών') 
	and not mw.ustring.find(cat_title, ' των ζωδίων')
	then
	toposwhere_label3 = get_topos_wherelabel3(toposwhere_label3)
	whereid3 = require("Module:topos/functions").catword_to_firstwhere(get_where_text3(where_text3))
	toposid = get_toposkind_id(toposwhere_label3)
--	cat_title = get_topos_wherelabel3(toposwhere_label3) .. ' ' .. get_where_text3(where_text3)

-- mode a
		if cat_parenthesis == '' or cat_parenthesis == nil then
			text = text_wikt .. ' » [[:Κατηγορία:Θεματικές κατηγορίες|Θεματικές κατηγορίες]]' 
			.. ' » [[:Κατηγορία:Ονομασίες|Ονομασίες]]' 
			.. ' » [[:Κατηγορία:Τοπωνύμια|<b>Τοπωνύμια</b>]]' 
			.. ' » [[:Κατηγορία:Τοπωνύμια ανά είδος|ανά είδος]]' 
			if mw.ustring.find(cat_title, 'Τοπωνύμια') then 
				text = text   -- no repetition. Check [[:Κατηγορία:Αεροδρόμια των ΗΠΑ]] -- [[:Κατηγορία:Τοπωνύμια των ΗΠΑ]]
			else
				if topos[toposid].parent2 ~= '' and topos[toposid].parent2 ~= nil then
				text = text .. ' » [[:Κατηγορία:' .. topos[toposid].parent2 .. '|' .. topos[toposid].parent2 .. ']]'
				end
				if topos[toposid].parent ~= '' and topos[toposid].parent ~= nil then
				text = text .. ' » [[:Κατηγορία:' .. topos[toposid].parent .. '|' .. topos[toposid].parent .. ']]'
				end
				text = text .. ' » [[:Κατηγορία:' .. topos[toposid].word_cat .. '|' .. topos[toposid].word_cat .. ']]' 
			end
			-- by place
			text = text .. ' :: [[:Κατηγορία:' .. topos[toposid].word_cat .. ' ανά τόπο|ανά τόπο]]' 
			if where[whereid3].parent4 ~= '' and where[whereid3].parent4 ~= nil then
				text = text .. ' » [[:Κατηγορία:' .. topos[toposid].word_cat .. ' ' .. where[whereid3].parent4 .. '|' .. where[whereid3].parent4 .. ']]'
			end
			if where[whereid3].parent3 ~= '' and where[whereid3].parent3 ~= nil then
				text = text .. ' » [[:Κατηγορία:' .. topos[toposid].word_cat .. ' ' .. where[whereid3].parent3 .. '|' .. where[whereid3].parent3 .. ']]'
			end	
			if where[whereid3].parent2 ~= '' and where[whereid3].parent2 ~= nil then
				text = text .. ' » [[:Κατηγορία:' .. topos[toposid].word_cat .. ' ' .. where[whereid3].parent2 .. '|' .. where[whereid3].parent2 .. ']]'
			end	
			if where[whereid3].parent ~= '' and where[whereid3].parent ~= nil then
				text = text .. ' » [[:Κατηγορία:' .. topos[toposid].word_cat .. ' ' .. where[whereid3].parent .. '|' .. where[whereid3].parent .. ']]'
			end	
			text = text .. ' » [[:Κατηγορία:' .. cat_title .. '|' .. where[whereid3].word_cat .. ']]' 
			if where[whereid3].extra1 ~= '' and where[whereid3].extra1 ~= nil then -- Θεματική
				text = text .. ' « [[:Κατηγορία:' .. topos[toposid].word_cat .. ' ' .. where[whereid3].extra1 .. '|' .. where[whereid3].extra1 .. ']]'
			end
			if where[whereid3].extra2 ~= '' and where[whereid3].extra2 ~= nil then
				text = text .. ' « [[:Κατηγορία:' .. topos[toposid].word_cat .. ' ' .. where[whereid3].extra2 .. '|' .. where[whereid3].extra2 .. ']]'
			end
			if where[whereid3].extra3 ~= '' and where[whereid3].extra3 ~= nil then
				text = text .. ' « [[:Κατηγορία:' .. topos[toposid].word_cat .. ' ' .. where[whereid3].extra3 .. '|' .. where[whereid3].extra3 .. ']]'
			end
-- ?? HOW do I write where_text		
			-- it will write nothing for no parent categories like Αεροδρόμια
			-- it should write Κατηγορία: parent των ΗΠΑ
			if topos[toposid].parent ~= '' and topos[toposid].parent ~= nil then
				text = text .. ' « [[:Κατηγορία:' .. topos[toposid].parent .. ' ' 
				.. 'των ' .. mw.ustring.sub(mw.ustring.match(cat_title, " των (.*)"), 1, -1) .. '|' 
				.. topos[toposid].parent .. ' των ' .. mw.ustring.sub(mw.ustring.match(cat_title, " των (.*)"), 1, -1) .. ']]'
			end		
			
			-- descr --  ------------------- toposwhere_label3 = topos[toposid]  
			if topos[toposid].descr ~= '' and topos[toposid].descr ~= nil then
				text_plus = '<dl><dd>' .. topos[toposid].descr .. '</dd></dl>'
			end	
-- see comment DIVISION above
			-- cat a -- parent ALWAYS, except continents. parent may COINCIDE with a continent category, that 's ok.		
			if where[whereid3].parent ~= '' and where[whereid3].parent ~= nil then
				cat = cat .. '[[Κατηγορία:' .. topos[toposid].word_cat .. ' ' .. where[whereid3].parent .. "|'" .. where[whereid3].key .. ']]' ..  "\n" -- sort apostroph
				if args['division'] == '1' or args['περιφέρεια'] == '1' then
				cat = cat
				else		
				cat = cat .. '[[Κατηγορία:' .. topos[toposid].word_cat .. " ανά τόπο|'" .. where[whereid3].key .. ']]' ..  "\n"
				end
			end	
			-- no example
			if mw.ustring.find(cat_title, 'Τοπωνύμια') then -- [[:Κατηγορία:Τοπωνύμια της Ευρώπης]] 
				if mw.ustring.find(cat_title, 'Αμερικής') or mw.ustring.find(cat_title, 'Ανταρκτικ') or mw.ustring.find(cat_title, 'Ασίας')
				 or mw.ustring.find(cat_title, 'Αφρικής') or mw.ustring.find(cat_title, 'Ευρώπης') or mw.ustring.find(cat_title, 'Ωκεανίας')
				 or mw.ustring.find(cat_title, 'Αρκτικού') or mw.ustring.find(cat_title, 'Ατλαντικού')
				 or mw.ustring.find(cat_title, 'Ειρηνικού') or mw.ustring.find(cat_title, 'Ινδικού') or mw.ustring.find(cat_title, 'Σύμπαντος') then
				 cat = '[[Κατηγορία:Τοπωνύμια ανά τόπο| ' .. where[whereid3].key .. ']]' ..  "\n" -- sort top
			-- [[:Κατηγορία:Τοπωνύμια των ΗΠΑ]]
				else cat = cat
				end
			-- no example
			elseif mw.ustring.find(cat_title, 'Αμερικής') or mw.ustring.find(cat_title, 'Ανταρκτικ') or mw.ustring.find(cat_title, 'Ασίας')
				 or mw.ustring.find(cat_title, 'Αφρικής') or mw.ustring.find(cat_title, 'Ευρώπης') or mw.ustring.find(cat_title, 'Ωκεανίας')
				 or mw.ustring.find(cat_title, 'Αρκτικού') or mw.ustring.find(cat_title, 'Ατλαντικού')
				 or mw.ustring.find(cat_title, 'Ειρηνικού') or mw.ustring.find(cat_title, 'Ινδικού') or mw.ustring.find(cat_title, 'Σύμπαντος') then
				cat = cat .. '[[Κατηγορία:' .. topos[toposid].word_cat .. ' ανά τόπο| ' .. where[whereid3].key .. ']]' ..  "\n" -- sort top	
				.. '[[Κατηγορία:Τοπωνύμια ' .. where[whereid3].word_cat .. '| ' .. topos[toposid].key .. ']]' ..  "\n" -- sort top
--				.. '[[Κατηγορία:Τοπωνύμια ανά τόπο| ' .. where[whereid3].key .. ']]' ..  "\n" -- sort top -- no, too many
-- ?? HOW do I write where_text		
			if topos[toposid].parent ~= '' and topos[toposid].parent ~= nil then
				cat = cat .. '[[Κατηγορία:' .. topos[toposid].parent .. ' ' 
				.. 'των ' .. mw.ustring.sub(mw.ustring.match(cat_title, " των (.*)"), 1, -1) .. '| ]]' ..  "\n" -- sort top
			end

			 -- [[:Κατηγορία:Αεροδρόμια των ΗΠΑ]]
			else
				cat = cat .. '[[Κατηγορία:' .. topos[toposid].word_cat .. ' ' ..  where[whereid3].parent .. "|'" .. where[whereid3].key .. ']]' ..  "\n" -- sort apostroph
				.. '[[Κατηγορία:Τοπωνύμια ' .. where[whereid3].word_cat .. '| ' .. topos[toposid].key .. ']]' ..  "\n"  -- sort top
				 end
-- ?? HOW do I write where_text		
			if topos[toposid].parent ~= '' and topos[toposid].parent ~= nil then
				cat = cat .. '[[Κατηγορία:' .. topos[toposid].parent .. ' ' 
				.. 'των ' .. mw.ustring.sub(mw.ustring.match(cat_title, " των (.*)"), 1, -1) .. '| ]]' ..  "\n" -- sort top
			end		 
			-- no example (διπλή υπαγωγή, Ευρώπη + extra Ασία)
			if where[whereid3].extra1 ~= '' and where[whereid3].extra1 ~= nil then -- Θεματική
				cat = cat .. '[[Κατηγορία:'  .. topos[toposid].word_cat .. ' ' .. where[whereid3].extra1 .. '| ' .. topos[toposid].key .. ']]' ..  "\n" -- sort top
			end
			if where[whereid3].extra2 ~= '' and where[whereid3].extra2 ~= nil then -- Θεματική
				cat = cat .. '[[Κατηγορία:'  .. topos[toposid].word_cat .. ' ' .. where[whereid3].extra2 .. '| ' .. topos[toposid].key .. ']]' ..  "\n" -- sort top
			end
			if where[whereid3].extra3 ~= '' and where[whereid3].extra3 ~= nil then -- Θεματική
				cat = cat .. '[[Κατηγορία:'  .. topos[toposid].word_cat .. ' ' .. where[whereid3].extra3 .. '| ' .. topos[toposid].key .. ']]' ..  "\n" -- sort top
			end
			
-- b mode	
		else
			text = text_lang .. ' » [[:Κατηγορία:Θεματικές κατηγορίες (' .. lang_name .. ')|Θεματικές κατηγορίες]]' 
			.. ' » [[:Κατηγορία:Ονομασίες (' .. lang_name .. ')|Ονομασίες]]'
			.. ' » [[:Κατηγορία:Τοπωνύμια (' .. lang_name .. ')|<b>Τοπωνύμια</b> » ανά είδος]]'  -- Places + places by kind coincide when +language
			if mw.ustring.find(cat_title, 'Τοπωνύμια') then 
				text = text  -- no repetition. Check [[:Κατηγορία:Πόλεις των ΗΠΑ (νέα ελληνικά)]] -- [[:Κατηγορία:Τοπωνύμια των ΗΠΑ (νέα ελληνικά)]]
			else
				if topos[toposid].parent2 ~= '' and topos[toposid].parent2 ~= nil then
				text = text .. ' » [[:Κατηγορία:' .. topos[toposid].parent2 .. ' (' .. lang_name .. ')|' .. topos[toposid].parent2 .. ']]'
				end
				if topos[toposid].parent ~= '' and topos[toposid].parent ~= nil then
				text = text .. ' » [[:Κατηγορία:' .. topos[toposid].parent .. ' (' .. lang_name .. ')|' .. topos[toposid].parent .. ']]'
				end

				text = text .. ' » [[:Κατηγορία:' .. topos[toposid].word_cat .. ' (' .. lang_name .. ')|' .. topos[toposid].word_cat .. ']]' 
			end
			-- by place+lang
			text = text .. ' :: [[:Κατηγορία:' .. topos[toposid].word_cat .. ' ανά τόπο (' .. lang_name .. ')|ανά τόπο]]' 			
			if where[whereid3].parent4 ~= '' and where[whereid3].parent4 ~= nil then
				text = text .. ' » [[:Κατηγορία:' .. topos[toposid].word_cat .. ' ' .. where[whereid3].parent4 .. ' (' .. lang_name .. ')|' .. where[whereid3].parent4 .. ']]'
			end	
			if where[whereid3].parent3 ~= '' and where[whereid3].parent3 ~= nil then
				text = text .. ' » [[:Κατηγορία:' .. topos[toposid].word_cat .. ' ' .. where[whereid3].parent3 .. ' (' .. lang_name .. ')|' .. where[whereid3].parent3 .. ']]'
			end	
			if where[whereid3].parent2 ~= '' and where[whereid3].parent2 ~= nil then
				text = text .. ' » [[:Κατηγορία:' .. topos[toposid].word_cat .. ' ' .. where[whereid3].parent2 .. ' (' .. lang_name .. ')|' .. where[whereid3].parent2 .. ']]'
			end	
			if where[whereid3].parent ~= '' and where[whereid3].parent ~= nil then
				text = text .. ' » [[:Κατηγορία:' .. topos[toposid].word_cat .. ' ' .. where[whereid3].parent .. ' (' .. lang_name .. ')|' .. where[whereid3].parent .. ']]'
			end	
			text = text .. ' » [[:Κατηγορία:' .. cat_title .. ' (' .. lang_name .. ')|' .. where[whereid3].word_cat .. ']]' -- [[:Κατηγορία:Αεροδρόμια των ΗΠΑ (νέα ελληνικά)]]
			.. ' [[:Κατηγορία:' .. topos[toposid].word_cat .. ' ' .. where[whereid3].word_cat .. '|«««]]' -- [[:Κατηγορία:Αεροδόμια των ΗΠΑ]]
			if languages[lang_iso].sublang == true then
			text = text .. ' [[:Κατηγορία:' .. cat_title .. ' (' .. languages[lang_iso].host_name .. ')|«' .. languages[lang_iso].host_name .. ']]'
			end
			if where[whereid3].extra1 ~= '' and where[whereid3].extra1 ~= nil then -- Θεματική
				text = text .. ' « [[:Κατηγορία:' .. topos[toposid].word_cat .. ' ' .. where[whereid3].extra1 .. ' (' .. lang_name .. ')|' .. where[whereid3].extra1 .. ']]'
			end
-- ?? HOW do I write where_text		
			-- it will write nothing for no parent categories like Αεροδρόμια
			-- it should write Κατηγορία: parent των ΗΠΑ
			if topos[toposid].parent ~= '' and topos[toposid].parent ~= nil then
				text = text .. ' « [[:Κατηγορία:' .. topos[toposid].parent .. ' ' 
				.. 'των ' .. mw.ustring.sub(mw.ustring.match(cat_title, " των (.*)"), 1, -1)  .. ' (' .. lang_name .. ')|' 
				.. topos[toposid].parent .. ' των ' .. mw.ustring.sub(mw.ustring.match(cat_title, " των (.*)"), 1, -1) .. ']]'
			end			
			
			-- descr
			if topos[toposid].descr ~= '' and topos[toposid].descr ~= nil then
				text_plus = '<dl><dd>' .. topos[toposid].descr .. '</dd></dl>'
			end			
			
			
			-- cat b  -- parent ALWAYS, except continents. parent may COINCIDE with a continent category, that 's ok.
			 -- [[:Κατηγορία:Τοπωνύμια των ΗΠΑ (νέα ελληνικά)]] -- [[:Κατηγορία:Πόλεις των ΗΠΑ(νέα ελληνικά)]]
			cat = '[[Κατηγορία:' .. topos[toposid].word_cat .. ' ανά τόπο (' .. lang_name .. ")|'" .. where[whereid3].key .. ']]' ..  "\n"
			if mw.ustring.find(cat_title, 'Τοπωνύμια') then
				if mw.ustring.find(cat_title, 'Αμερικής') or mw.ustring.find(cat_title, 'Ανταρκτικ') or mw.ustring.find(cat_title, 'Ασίας')
				 or mw.ustring.find(cat_title, 'Αφρικής') or mw.ustring.find(cat_title, 'Ευρώπης') or mw.ustring.find(cat_title, 'Ωκεανίας')
				 or mw.ustring.find(cat_title, 'Αρκτικού') or mw.ustring.find(cat_title, 'Ατλαντικού')
				 or mw.ustring.find(cat_title, 'Ειρηνικού') or mw.ustring.find(cat_title, 'Ινδικού') or mw.ustring.find(cat_title, 'Σύμπαντος') then
				 cat = '[[Κατηγορία:Τοπωνύμια ' ..  where[whereid3].word_cat  .. '|' .. languages[lang_iso].key .. ']]' ..  "\n"
				 .. '[[Κατηγορία:Τοπωνύμια ανά τόπο (' .. lang_name .. ')| ' .. where[whereid3].key .. ']]' ..  "\n" -- sort top
				else  -- [[:Κατηγορία:Τοπωνύμια των ΗΠΑ (νέα ελληνικά)]]
					cat = '[[Κατηγορία:Τοπωνύμια ' ..  where[whereid3].word_cat  .. '|' .. languages[lang_iso].key .. ']]' ..  "\n"
					.. '[[Κατηγορία:Τοπωνύμια ανά τόπο (' .. lang_name .. ')|' .. where[whereid3].key .. ']]' ..  "\n"
				end
			elseif mw.ustring.find(cat_title, 'Αμερικής') or mw.ustring.find(cat_title, 'Ανταρκτικ') or mw.ustring.find(cat_title, 'Ασίας')
				 or mw.ustring.find(cat_title, 'Αφρικής') or mw.ustring.find(cat_title, 'Ευρώπης') or mw.ustring.find(cat_title, 'Ωκεανίας')
				 or mw.ustring.find(cat_title, 'Αρκτικού') or mw.ustring.find(cat_title, 'Ατλαντικού')
				 or mw.ustring.find(cat_title, 'Ειρηνικού') or mw.ustring.find(cat_title, 'Ινδικού') or mw.ustring.find(cat_title, 'Σύμπαντος') then
				 cat = '[[Κατηγορία:' .. topos[toposid].word_cat .. ' ' .. where[whereid3].word_cat .. '|' .. languages[lang_iso].key .. ']]' ..  "\n"
				 .. '[[Κατηγορία:' .. topos[toposid].word_cat .. ' ανά τόπο (' .. lang_name ..')| ' .. where[whereid3].key .. ']]' ..  "\n" -- sort top
				 .. '[[Κατηγορία:Τοπωνύμια ' .. where[whereid3].word_cat .. ' (' .. lang_name .. ')| ' .. where[whereid3].key .. ']]' ..  "\n" -- sort top
-- ?? HOW do I write where_text		
			if topos[toposid].parent ~= '' and topos[toposid].parent ~= nil then
				cat = cat .. '[[Κατηγορία:' .. topos[toposid].parent .. ' ' 
				.. 'των ' .. mw.ustring.sub(mw.ustring.match(cat_title, " των (.*)"), 1, -1)  .. ' (' .. lang_name .. ')| ]]' ..  "\n" -- sort top
			end		
			
			else -- [[:Κατηγορία:Πόλεις των ΗΠΑ (νέα ελληνικά)]]
				cat = cat .. '[[Κατηγορία:' .. topos[toposid].word_cat .. ' ' .. where[whereid3].word_cat .. '|' .. languages[lang_iso].key .. ']]' ..  "\n"
			end
			if where[whereid3].parent ~= '' and where[whereid3].parent ~= nil then
				cat = cat .. '[[Κατηγορία:' .. topos[toposid].word_cat .. ' ' .. where[whereid3].parent .. ' (' .. lang_name .. ")|'" .. where[whereid3].key .. ']]' ..  "\n" -- sort apostroph
			end	
-- ?? HOW do I write where_text		
			if topos[toposid].parent ~= '' and topos[toposid].parent ~= nil then
				cat = cat .. '[[Κατηγορία:' .. topos[toposid].parent .. ' ' 
				.. 'των ' .. mw.ustring.sub(mw.ustring.match(cat_title, " των (.*)"), 1, -1)  .. ' (' .. lang_name .. ')| ]]' ..  "\n" -- sort top
			end		
			if languages[lang_iso].sublang == true then
			cat = cat .. '[[Κατηγορία:' .. cat_title .. ' (' .. languages[lang_iso].host_name ..  ')|' .. languages[lang_iso].host_key .. ']]' .. "\n"
			end			
			-- extras no example (διπλή υπαγωγή, Ευρώπη + extra Ασία)
			if where[whereid3].extra1 ~= '' and where[whereid3].extra1 ~= nil then
				cat = cat .. '[[Κατηγορία:'  .. topos[toposid].word_cat .. ' ' .. where[whereid3].extra1 .. ' (' .. lang_name .. ')| ' .. topos[toposid].key .. ']]' ..  "\n" -- sort top
			end
			if where[whereid3].extra2 ~= '' and where[whereid3].extra2 ~= nil then
				cat = cat .. '[[Κατηγορία:'  .. topos[toposid].word_cat .. ' ' .. where[whereid3].extra2 .. ' (' .. lang_name .. ')| ' .. topos[toposid].key .. ']]' ..  "\n" -- sort top
			end
			if where[whereid3].extra3 ~= '' and where[whereid3].extra3 ~= nil then
				cat = cat .. '[[Κατηγορία:'  ..topos[toposid].word_cat .. ' ' ..  where[whereid3].extra3 .. ' (' .. lang_name .. ')| ' .. topos[toposid].key .. ']]' ..  "\n" -- sort top
			end
			
		end -- close parenthesis
	
end -- close if των and not, and not


end -- close FREE text which is at the top


-- FAILED: Lua error, template loop detected
-- add title, as though it was something else
--  "&#123;&#123;auto cat|free|iso=grc|text=" .. different_lemma .. "&#125;&#125;"
-- TEST: use |lemma=  & |cat=for categories semi-manual which we do not wish to include at data. e.g. [[:Κατηγορία:Κύρια ονόματα 1ης κλίσης αρσενικά χωρίς ενικό (αρχαία ελληνικά)]]
	different_lemma = args['lemma2'] or '' -- read a different title - link to different lemma but show the title as it is
		-- similar used as other_lemma at affixes
--		if different_lemma ~= '' and different_lemma ~= nil then
		if args['lemma2'] ~= '' and args['lemma2'] ~= nil then			
			page_text = args['lemma2']
		end

	different_cat = args['cat2'] or args['κατ2'] or '' -- Category for different lemma
		-- similar used as other_cat at affixes
		if args['cat2'] ~= '' and args['cat2'] ~= nil then
			cat = "[[Κατηγορία:" .. different_cat .. "]]"
		end
-- ========================================== OUTPUT
-- full index Categories (all memebers of subcategories are included)
	if args['index'] == '1' 
	-- or, only when (language) Animals, Plants
	or mw.ustring.find(page_text, "Ζώα %(") or mw.ustring.find(page_text, "Φυτά %(")
	then -- [[:Κατηγορία:Ζώα (νέα ελληνικά)]]
	text = '<table width=100%><tr><td style="font-size:small; background:#e4e4d4;">' .. text .. ' &nbsp;  (<b>index-ευρετήριο</b>)</td></tr></table>' .. text_plus	
	else
-- regular title
	text = '<table width=100%><tr><td style="font-size:small; background:#f8f8f8;">' .. text .. '</td></tr></table>' .. text_plus
	end

	if cat == '' or cat == nil then
		output = '<div style="font-size:20px; color:#b22222;">Λυπούμαστε, αλλά το auto cat δεν υποστηρίζει αυτή τη σελίδα!<br>'
		.. 'Sorry, auto cat is not supported for this page.</div>'
		.. ' [[Κατηγορία:Σελίδες με σφάλμα στο auto cat]]'
	elseif cat == '-' then
		output = text
	else
		output = text .. cat
	end

return output
end

return export