submenu $"Change language (press F2)" --hotkey 'f2' --id 'lang' { insmod regexp for langstr in \ "ru_RU=Russian" \ "en_US=English" \ "pt_BR=Portuguese" \ "uk_UA=Ukrainian" \ "uz_UZ=Uzbek" \ "ky_KG=Kyrgyz" \ "kk_KZ=Kazakh" \ ; do regexp -s 2:langname -s 1:langcode '(.*)=(.*)' "$langstr" for locale in @LOCALES@; do if [ "$locale" != "$langcode" ]; then continue; fi menuentry "${langname}" "$langcode" { lang="$2" export lang configfile ${prefix}/grub.cfg } done done menuentry $"Return to the Main menu" { configfile ${prefix}/grub.cfg } }