| 1 | package Daje::Plugin::Languages::Languages; | ||
| 2 | use Mojo::Base -base, -signatures; | ||
| 3 | use v5.42; | ||
| 4 | |||
| 5 | # NAME | ||
| 6 | # ==== | ||
| 7 | # | ||
| 8 | # Daje::Plugin::Languages::Languages - Model class | ||
| 9 | # | ||
| 10 | # SYNOPSIS | ||
| 11 | # ======== | ||
| 12 | # | ||
| 13 | # | ||
| 14 | # | ||
| 15 | # | ||
| 16 | # DESCRIPTION | ||
| 17 | # =========== | ||
| 18 | # | ||
| 19 | # Daje::Plugin::Languages::Languages is the standard routes | ||
| 20 | # | ||
| 21 | # METHODS | ||
| 22 | # ======= | ||
| 23 | # | ||
| 24 | # | ||
| 25 | # LICENSE | ||
| 26 | # ======= | ||
| 27 | # | ||
| 28 | # Copyright (C) janeskil1525. | ||
| 29 | # | ||
| 30 | # This library is free software; you can redistribute it and/or modify | ||
| 31 | # it under the same terms as Perl itself. | ||
| 32 | # | ||
| 33 | # AUTHOR | ||
| 34 | # ====== | ||
| 35 | # | ||
| 36 | # janeskil1525 E<lt>janeskil1525@gmail.com | ||
| 37 | # | ||
| 38 | |||
| 39 | # This file is generated automatically by Daje Tools 2026-02-25 11:52:04. | ||
| 40 | # It will be generated by Daje Tools again. | ||
| 41 | # <!-- Autogenerated file 2026-02-25 11:52:04 --> | ||
| 42 | |||
| 43 | use Daje::Helper::Languages::InsertKeys; | ||
| 44 | |||
| 45 | has 'db'; | ||
| 46 | |||
| 47 | sub language($self) { | ||
| 48 | |||
| 49 | try { | ||
| 50 | my $tx = $self->db->begin; | ||
| 51 | my @keys; | ||
| 52 | push @keys, { | ||
| 53 | plugin => 'languages', | ||
| 54 | key => 'types', | ||
| 55 | field => 'table', | ||
| 56 | type => 'Label', | ||
| 57 | translation => 'Types', | ||
| 58 | comment => 'Translation types, field tooltip grid ', | ||
| 59 | }; | ||
| 60 | push @keys, { | ||
| 61 | plugin => 'languages', | ||
| 62 | key => 'types', | ||
| 63 | field => 'type', | ||
| 64 | type => 'Label', | ||
| 65 | translation => 'Type', | ||
| 66 | comment => 'Type of translation, field tooltip help etc' | ||
| 67 | }; | ||
| 68 | push @keys, { | ||
| 69 | plugin => 'languages', | ||
| 70 | key => 'types', | ||
| 71 | field => 'type', | ||
| 72 | type => 'Tool tips', | ||
| 73 | translation => 'Type of translation, field tooltip help etc', | ||
| 74 | comment => 'Type of translation, field tooltip help etc' | ||
| 75 | }; | ||
| 76 | |||
| 77 | push @keys, { | ||
| 78 | plugin => 'languages', | ||
| 79 | key => 'translations', | ||
| 80 | field => 'table', | ||
| 81 | type => 'Label', | ||
| 82 | translation => 'Translations', | ||
| 83 | comment => 'Translations', | ||
| 84 | }; | ||
| 85 | push @keys, { | ||
| 86 | plugin => 'languages', | ||
| 87 | key => 'translations', | ||
| 88 | field => 'lan', | ||
| 89 | type => 'Label', | ||
| 90 | translation => '', | ||
| 91 | comment => '' | ||
| 92 | }; | ||
| 93 | push @keys, { | ||
| 94 | plugin => 'languages', | ||
| 95 | key => 'translations', | ||
| 96 | field => 'lan', | ||
| 97 | type => 'Tool tips', | ||
| 98 | translation => '', | ||
| 99 | comment => '' | ||
| 100 | }; | ||
| 101 | |||
| 102 | push @keys, { | ||
| 103 | plugin => 'languages', | ||
| 104 | key => 'translations', | ||
| 105 | field => 'translation_keys', | ||
| 106 | type => 'Label', | ||
| 107 | translation => '', | ||
| 108 | comment => '' | ||
| 109 | }; | ||
| 110 | push @keys, { | ||
| 111 | plugin => 'languages', | ||
| 112 | key => 'translations', | ||
| 113 | field => 'translation_keys', | ||
| 114 | type => 'Tool tips', | ||
| 115 | translation => '', | ||
| 116 | comment => '' | ||
| 117 | }; | ||
| 118 | |||
| 119 | push @keys, { | ||
| 120 | plugin => 'languages', | ||
| 121 | key => 'translations', | ||
| 122 | field => 'translation', | ||
| 123 | type => 'Label', | ||
| 124 | translation => 'Translation', | ||
| 125 | comment => 'Translation to selected language' | ||
| 126 | }; | ||
| 127 | push @keys, { | ||
| 128 | plugin => 'languages', | ||
| 129 | key => 'translations', | ||
| 130 | field => 'translation', | ||
| 131 | type => 'Tool tips', | ||
| 132 | translation => 'Translation to selected language', | ||
| 133 | comment => 'Translation to selected language' | ||
| 134 | }; | ||
| 135 | |||
| 136 | push @keys, { | ||
| 137 | plugin => 'languages', | ||
| 138 | key => 'translations', | ||
| 139 | field => 'locked', | ||
| 140 | type => 'Label', | ||
| 141 | translation => 'Locked', | ||
| 142 | comment => 'Translation locked for automatic updates' | ||
| 143 | }; | ||
| 144 | push @keys, { | ||
| 145 | plugin => 'languages', | ||
| 146 | key => 'translations', | ||
| 147 | field => 'locked', | ||
| 148 | type => 'Tool tips', | ||
| 149 | translation => 'Translation locked for automatic updates', | ||
| 150 | comment => 'Translation locked for automatic updates' | ||
| 151 | }; | ||
| 152 | |||
| 153 | push @keys, { | ||
| 154 | plugin => 'languages', | ||
| 155 | key => 'lan', | ||
| 156 | field => 'table', | ||
| 157 | type => 'Label', | ||
| 158 | translation => 'Language', | ||
| 159 | comment => 'The supported languages', | ||
| 160 | }; | ||
| 161 | push @keys, { | ||
| 162 | plugin => 'languages', | ||
| 163 | key => 'lan', | ||
| 164 | field => 'language', | ||
| 165 | type => 'Label', | ||
| 166 | translation => 'Language', | ||
| 167 | comment => 'Language full name' | ||
| 168 | }; | ||
| 169 | push @keys, { | ||
| 170 | plugin => 'languages', | ||
| 171 | key => 'lan', | ||
| 172 | field => 'language', | ||
| 173 | type => 'Tool tips', | ||
| 174 | translation => 'Language full name', | ||
| 175 | comment => 'Language full name' | ||
| 176 | }; | ||
| 177 | |||
| 178 | push @keys, { | ||
| 179 | plugin => 'languages', | ||
| 180 | key => 'lan', | ||
| 181 | field => 'browser_code', | ||
| 182 | type => 'Label', | ||
| 183 | translation => 'Browser code', | ||
| 184 | comment => 'Language code in the browser' | ||
| 185 | }; | ||
| 186 | push @keys, { | ||
| 187 | plugin => 'languages', | ||
| 188 | key => 'lan', | ||
| 189 | field => 'browser_code', | ||
| 190 | type => 'Tool tips', | ||
| 191 | translation => 'Language code in the browser', | ||
| 192 | comment => 'Language code in the browser' | ||
| 193 | }; | ||
| 194 | |||
| 195 | push @keys, { | ||
| 196 | plugin => 'languages', | ||
| 197 | key => 'lan', | ||
| 198 | field => 'iso_code', | ||
| 199 | type => 'Label', | ||
| 200 | translation => 'ISO Code', | ||
| 201 | comment => 'Language ISO Code' | ||
| 202 | }; | ||
| 203 | push @keys, { | ||
| 204 | plugin => 'languages', | ||
| 205 | key => 'lan', | ||
| 206 | field => 'iso_code', | ||
| 207 | type => 'Tool tips', | ||
| 208 | translation => 'Language ISO Code', | ||
| 209 | comment => 'Language ISO Code' | ||
| 210 | }; | ||
| 211 | |||
| 212 | push @keys, { | ||
| 213 | plugin => 'languages', | ||
| 214 | key => 'translation_keys', | ||
| 215 | field => 'table', | ||
| 216 | type => 'Label', | ||
| 217 | translation => '', | ||
| 218 | comment => '', | ||
| 219 | }; | ||
| 220 | push @keys, { | ||
| 221 | plugin => 'languages', | ||
| 222 | key => 'translation_keys', | ||
| 223 | field => 'plugin', | ||
| 224 | type => 'Label', | ||
| 225 | translation => '', | ||
| 226 | comment => '' | ||
| 227 | }; | ||
| 228 | push @keys, { | ||
| 229 | plugin => 'languages', | ||
| 230 | key => 'translation_keys', | ||
| 231 | field => 'plugin', | ||
| 232 | type => 'Tool tips', | ||
| 233 | translation => '', | ||
| 234 | comment => '' | ||
| 235 | }; | ||
| 236 | |||
| 237 | push @keys, { | ||
| 238 | plugin => 'languages', | ||
| 239 | key => 'translation_keys', | ||
| 240 | field => 'field', | ||
| 241 | type => 'Label', | ||
| 242 | translation => 'Field', | ||
| 243 | comment => 'Translated field' | ||
| 244 | }; | ||
| 245 | push @keys, { | ||
| 246 | plugin => 'languages', | ||
| 247 | key => 'translation_keys', | ||
| 248 | field => 'field', | ||
| 249 | type => 'Tool tips', | ||
| 250 | translation => 'Translated field', | ||
| 251 | comment => 'Translated field' | ||
| 252 | }; | ||
| 253 | |||
| 254 | push @keys, { | ||
| 255 | plugin => 'languages', | ||
| 256 | key => 'translation_keys', | ||
| 257 | field => 'types', | ||
| 258 | type => 'Label', | ||
| 259 | translation => 'Types', | ||
| 260 | comment => 'Type of translation' | ||
| 261 | }; | ||
| 262 | push @keys, { | ||
| 263 | plugin => 'languages', | ||
| 264 | key => 'translation_keys', | ||
| 265 | field => 'types', | ||
| 266 | type => 'Tool tips', | ||
| 267 | translation => 'Type of translation, field tooltip help etc', | ||
| 268 | comment => 'Type of translation' | ||
| 269 | }; | ||
| 270 | |||
| 271 | push @keys, { | ||
| 272 | plugin => 'languages', | ||
| 273 | key => 'translation_keys', | ||
| 274 | field => 'key', | ||
| 275 | type => 'Label', | ||
| 276 | translation => 'Key', | ||
| 277 | comment => 'Key or table the translation belongs to' | ||
| 278 | }; | ||
| 279 | push @keys, { | ||
| 280 | plugin => 'languages', | ||
| 281 | key => 'translation_keys', | ||
| 282 | field => 'key', | ||
| 283 | type => 'Tool tips', | ||
| 284 | translation => 'Key or table the translation belongs to', | ||
| 285 | comment => 'Key or table the translation belongs to' | ||
| 286 | }; | ||
| 287 | |||
| 288 | push @keys, { | ||
| 289 | plugin => 'languages', | ||
| 290 | key => 'translation_keys', | ||
| 291 | field => 'comment', | ||
| 292 | type => 'Label', | ||
| 293 | translation => 'Comment', | ||
| 294 | comment => 'Comment to help understand context' | ||
| 295 | }; | ||
| 296 | push @keys, { | ||
| 297 | plugin => 'languages', | ||
| 298 | key => 'translation_keys', | ||
| 299 | field => 'comment', | ||
| 300 | type => 'Tool tips', | ||
| 301 | translation => 'Comment to help understand context', | ||
| 302 | comment => 'Comment to help understand context' | ||
| 303 | }; | ||
| 304 | |||
| 305 | |||
| 306 | Daje::Helper::Languages::InsertKeys->new( | ||
| 307 | db => $self->db | ||
| 308 | )->process( | ||
| 309 | \@keys | ||
| 310 | ); | ||
| 311 | $tx->commit(); | ||
| 312 | } catch($e) { | ||
| 313 | say $e; | ||
| 314 | } | ||
| 315 | } | ||
| 316 | |||
| 317 | 1; | ||
| 318 | |||
| 319 |