# Transliteration is possible?

**URL:** https://resource.dopus.com/t/transliteration-is-possible/40087
**Category:** Help & Support
**Created:** [December 16, 2021, 9:10am UTC](https://resource.dopus.com/t/transliteration-is-possible/40087 "2021-12-16T09:10:11Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![fkast](https://resource.dopus.com/user_avatar/resource.dopus.com/fkast/32/26108_2.png) [@fkast](https://resource.dopus.com/u/fkast)
#### Post date: [December 16, 2021, 9:10am UTC](https://resource.dopus.com/t/transliteration-is-possible/40087/1 "2021-12-16T09:10:11Z")

</div>

Hello. i found only a topic with dynamic renamer that was 9 years ago. may be there is a new and simple method to transliterate names like in totalcommander(sorry, never use it, but found this possibility in it via search) Dopus's find&replace doesn't accept () | or \*

 ![image](https://resource.dopus.com/uploads/default/original/3X/e/4/e45c87c9021f3079bb2b31f029c6aa9a6d699c6c.png)

---

<div class="post-metadata">

### Author: ![Leo](https://resource.dopus.com/user_avatar/resource.dopus.com/leo/32/69732_2.png) [@Leo](https://resource.dopus.com/u/Leo)
#### Post date: [December 16, 2021, 3:52pm UTC](https://resource.dopus.com/t/transliteration-is-possible/40087/2 "2021-12-16T15:52:12Z")

</div>

Using a rename script would be best for that, if you mean mapping one character set to another. It's not something you can do with a single regex, wildcard, or search & replace operation, but it'd be easy to do with a little script that loops through each character and replaces it according to whichever rules you want.

---

<div class="post-metadata">

### Author: ![fkast](https://resource.dopus.com/user_avatar/resource.dopus.com/fkast/32/26108_2.png) [@fkast](https://resource.dopus.com/u/fkast)
#### Post date: [December 16, 2021, 7:08pm UTC](https://resource.dopus.com/t/transliteration-is-possible/40087/3 "2021-12-16T19:08:57Z")

</div>

i just found

```nohighlight
function translit_file($filename)
{
	$converter = array(
		'а' => 'a', 'б' => 'b', 'в' => 'v', 'г' => 'g', 'д' => 'd',
		'е' => 'e', 'ё' => 'e', 'ж' => 'zh', 'з' => 'z', 'и' => 'i',
		'й' => 'y', 'к' => 'k', 'л' => 'l', 'м' => 'm', 'н' => 'n',
		'о' => 'o', 'п' => 'p', 'р' => 'r', 'с' => 's', 'т' => 't',
		'у' => 'u', 'ф' => 'f', 'х' => 'h', 'ц' => 'c', 'ч' => 'ch',
		'ш' => 'sh', 'щ' => 'sch', 'ь' => '', 'ы' => 'y', 'ъ' => '',
		'э' => 'e', 'ю' => 'yu', 'я' => 'ya',
 
		'А' => 'A', 'Б' => 'B', 'В' => 'V', 'Г' => 'G', 'Д' => 'D',
		'Е' => 'E', 'Ё' => 'E', 'Ж' => 'Zh', 'З' => 'Z', 'И' => 'I',
		'Й' => 'Y', 'К' => 'K', 'Л' => 'L', 'М' => 'M', 'Н' => 'N',
		'О' => 'O', 'П' => 'P', 'Р' => 'R', 'С' => 'S', 'Т' => 'T',
		'У' => 'U', 'Ф' => 'F', 'Х' => 'H', 'Ц' => 'C', 'Ч' => 'Ch',
		'Ш' => 'Sh', 'Щ' => 'Sch', 'Ь' => '', 'Ы' => 'Y', 'Ъ' => '',
		'Э' => 'E', 'Ю' => 'Yu', 'Я' => 'Ya',
	);
	
	$new = '';
	
	$file = pathinfo(trim($filename));
	if (!empty($file['dirname']) && @$file['dirname'] != '.') {
		$new .= rtrim($file['dirname'], '/') . '/';
	}
 
	if (!empty($file['filename'])) {
		$file['filename'] = str_replace(array(' ', ','), '-', $file['filename']);
		$file['filename'] = strtr($file['filename'], $converter);
		$file['filename'] = mb_ereg_replace('[-]+', '-', $file['filename']);
		$file['filename'] = trim($file['filename'], '-');					
		$new .= $file['filename'];
	}
 
	if (!empty($file['extension'])) {
		$new .= '.' . $file['extension'];
	}
	
	return $new;
}
 
echo translit_file('/upload/Пример файла.jpg');

```

or this

```nohighlight
function translit(word){
   var answer = '';
   var converter = {
   	'а': 'a', 'б': 'b', 'в': 'v', 'г': 'g', 'д': 'd',
   	'е': 'e', 'ё': 'e', 'ж': 'zh', 'з': 'z', 'и': 'i',
   	'й': 'y', 'к': 'k', 'л': 'l', 'м': 'm', 'н': 'n',
   	'о': 'o', 'п': 'p', 'р': 'r', 'с': 's', 'т': 't',
   	'у': 'u', 'ф': 'f', 'х': 'h', 'ц': 'c', 'ч': 'ch',
   	'ш': 'sh', 'щ': 'sch', 'ь': '', 'ы': 'y', 'ъ': '',
   	'э': 'e', 'ю': 'yu', 'я': 'ya',

   	'А': 'A', 'Б': 'B', 'В': 'V', 'Г': 'G', 'Д': 'D',
   	'Е': 'E', 'Ё': 'E', 'Ж': 'Zh', 'З': 'Z', 'И': 'I',
   	'Й': 'Y', 'К': 'K', 'Л': 'L', 'М': 'M', 'Н': 'N',
   	'О': 'O', 'П': 'P', 'Р': 'R', 'С': 'S', 'Т': 'T',
   	'У': 'U', 'Ф': 'F', 'Х': 'H', 'Ц': 'C', 'Ч': 'Ch',
   	'Ш': 'Sh', 'Щ': 'Sch', 'Ь': '', 'Ы': 'Y', 'Ъ': '',
   	'Э': 'E', 'Ю': 'Yu', 'Я': 'Ya'
   };

   for (var i = 0; i < word.length; ++i ) {
   	if (converter[word[i]] == undefined){
   		answer += word[i];
   	} else {
   		answer += converter[word[i]];
   	}
   }

   return answer;
}

```

but it doesn't work with rename script and i'm not familiar to edit it properly. is anybody can?

---

<div class="post-metadata">

### Author: ![Leo](https://resource.dopus.com/user_avatar/resource.dopus.com/leo/32/69732_2.png) [@Leo](https://resource.dopus.com/u/Leo)
#### Post date: [December 20, 2021, 6:03pm UTC](https://resource.dopus.com/t/transliteration-is-possible/40087/4 "2021-12-20T18:03:22Z")

</div>

Set the language to JScript and add this to the top of your second script:

```javascript
function OnGetNewName(getNewNameData)
{
	return translit(getNewNameData.newname);
}

```

 ![image](https://resource.dopus.com/uploads/default/original/3X/e/c/ec08347a0659e5faf8dc822991d8b2c9131896ac.png)
