Mercurial > defr > drupal > core
comparison modules/locale/locale.install @ 19:3edae6ecd6c6 6.9
Drupal 6.9
| author | Franck Deroche <franck@defr.org> |
|---|---|
| date | Thu, 15 Jan 2009 10:15:56 +0100 |
| parents | c1f4ac30525a |
| children |
comparison
equal
deleted
inserted
replaced
| 18:f5131a9cd9e5 | 19:3edae6ecd6c6 |
|---|---|
| 1 <?php | 1 <?php |
| 2 // $Id: locale.install,v 1.27 2008/01/10 14:35:24 goba Exp $ | 2 // $Id: locale.install,v 1.27.2.1 2009/01/06 15:46:37 goba Exp $ |
| 3 | 3 |
| 4 /** | 4 /** |
| 5 * Implementation of hook_install(). | 5 * Implementation of hook_install(). |
| 6 */ | 6 */ |
| 7 function locale_install() { | 7 function locale_install() { |
| 224 /** | 224 /** |
| 225 * Implementation of hook_schema(). | 225 * Implementation of hook_schema(). |
| 226 */ | 226 */ |
| 227 function locale_schema() { | 227 function locale_schema() { |
| 228 $schema['languages'] = array( | 228 $schema['languages'] = array( |
| 229 'description' => t('List of all available languages in the system.'), | 229 'description' => 'List of all available languages in the system.', |
| 230 'fields' => array( | 230 'fields' => array( |
| 231 'language' => array( | 231 'language' => array( |
| 232 'type' => 'varchar', | 232 'type' => 'varchar', |
| 233 'length' => 12, | 233 'length' => 12, |
| 234 'not null' => TRUE, | 234 'not null' => TRUE, |
| 235 'default' => '', | 235 'default' => '', |
| 236 'description' => t("Language code, e.g. 'de' or 'en-US'."), | 236 'description' => "Language code, e.g. 'de' or 'en-US'.", |
| 237 ), | 237 ), |
| 238 'name' => array( | 238 'name' => array( |
| 239 'type' => 'varchar', | 239 'type' => 'varchar', |
| 240 'length' => 64, | 240 'length' => 64, |
| 241 'not null' => TRUE, | 241 'not null' => TRUE, |
| 242 'default' => '', | 242 'default' => '', |
| 243 'description' => t('Language name in English.'), | 243 'description' => 'Language name in English.', |
| 244 ), | 244 ), |
| 245 'native' => array( | 245 'native' => array( |
| 246 'type' => 'varchar', | 246 'type' => 'varchar', |
| 247 'length' => 64, | 247 'length' => 64, |
| 248 'not null' => TRUE, | 248 'not null' => TRUE, |
| 249 'default' => '', | 249 'default' => '', |
| 250 'description' => t('Native language name.'), | 250 'description' => 'Native language name.', |
| 251 ), | 251 ), |
| 252 'direction' => array( | 252 'direction' => array( |
| 253 'type' => 'int', | 253 'type' => 'int', |
| 254 'not null' => TRUE, | 254 'not null' => TRUE, |
| 255 'default' => 0, | 255 'default' => 0, |
| 256 'description' => t('Direction of language (Left-to-Right = 0, Right-to-Left = 1).'), | 256 'description' => 'Direction of language (Left-to-Right = 0, Right-to-Left = 1).', |
| 257 ), | 257 ), |
| 258 'enabled' => array( | 258 'enabled' => array( |
| 259 'type' => 'int', | 259 'type' => 'int', |
| 260 'not null' => TRUE, | 260 'not null' => TRUE, |
| 261 'default' => 0, | 261 'default' => 0, |
| 262 'description' => t('Enabled flag (1 = Enabled, 0 = Disabled).'), | 262 'description' => 'Enabled flag (1 = Enabled, 0 = Disabled).', |
| 263 ), | 263 ), |
| 264 'plurals' => array( | 264 'plurals' => array( |
| 265 'type' => 'int', | 265 'type' => 'int', |
| 266 'not null' => TRUE, | 266 'not null' => TRUE, |
| 267 'default' => 0, | 267 'default' => 0, |
| 268 'description' => t('Number of plural indexes in this language.'), | 268 'description' => 'Number of plural indexes in this language.', |
| 269 ), | 269 ), |
| 270 'formula' => array( | 270 'formula' => array( |
| 271 'type' => 'varchar', | 271 'type' => 'varchar', |
| 272 'length' => 128, | 272 'length' => 128, |
| 273 'not null' => TRUE, | 273 'not null' => TRUE, |
| 274 'default' => '', | 274 'default' => '', |
| 275 'description' => t('Plural formula in PHP code to evaluate to get plural indexes.'), | 275 'description' => 'Plural formula in PHP code to evaluate to get plural indexes.', |
| 276 ), | 276 ), |
| 277 'domain' => array( | 277 'domain' => array( |
| 278 'type' => 'varchar', | 278 'type' => 'varchar', |
| 279 'length' => 128, | 279 'length' => 128, |
| 280 'not null' => TRUE, | 280 'not null' => TRUE, |
| 281 'default' => '', | 281 'default' => '', |
| 282 'description' => t('Domain to use for this language.'), | 282 'description' => 'Domain to use for this language.', |
| 283 ), | 283 ), |
| 284 'prefix' => array( | 284 'prefix' => array( |
| 285 'type' => 'varchar', | 285 'type' => 'varchar', |
| 286 'length' => 128, | 286 'length' => 128, |
| 287 'not null' => TRUE, | 287 'not null' => TRUE, |
| 288 'default' => '', | 288 'default' => '', |
| 289 'description' => t('Path prefix to use for this language.'), | 289 'description' => 'Path prefix to use for this language.', |
| 290 ), | 290 ), |
| 291 'weight' => array( | 291 'weight' => array( |
| 292 'type' => 'int', | 292 'type' => 'int', |
| 293 'not null' => TRUE, | 293 'not null' => TRUE, |
| 294 'default' => 0, | 294 'default' => 0, |
| 295 'description' => t('Weight, used in lists of languages.'), | 295 'description' => 'Weight, used in lists of languages.', |
| 296 ), | 296 ), |
| 297 'javascript' => array( | 297 'javascript' => array( |
| 298 'type' => 'varchar', | 298 'type' => 'varchar', |
| 299 'length' => 32, | 299 'length' => 32, |
| 300 'not null' => TRUE, | 300 'not null' => TRUE, |
| 301 'default' => '', | 301 'default' => '', |
| 302 'description' => t('Location of JavaScript translation file.'), | 302 'description' => 'Location of JavaScript translation file.', |
| 303 ), | 303 ), |
| 304 ), | 304 ), |
| 305 'primary key' => array('language'), | 305 'primary key' => array('language'), |
| 306 'indexes' => array( | 306 'indexes' => array( |
| 307 'list' => array('weight', 'name'), | 307 'list' => array('weight', 'name'), |
| 308 ), | 308 ), |
| 309 ); | 309 ); |
| 310 | 310 |
| 311 $schema['locales_source'] = array( | 311 $schema['locales_source'] = array( |
| 312 'description' => t('List of English source strings.'), | 312 'description' => 'List of English source strings.', |
| 313 'fields' => array( | 313 'fields' => array( |
| 314 'lid' => array( | 314 'lid' => array( |
| 315 'type' => 'serial', | 315 'type' => 'serial', |
| 316 'not null' => TRUE, | 316 'not null' => TRUE, |
| 317 'description' => t('Unique identifier of this string.'), | 317 'description' => 'Unique identifier of this string.', |
| 318 ), | 318 ), |
| 319 'location' => array( | 319 'location' => array( |
| 320 'type' => 'varchar', | 320 'type' => 'varchar', |
| 321 'length' => 255, | 321 'length' => 255, |
| 322 'not null' => TRUE, | 322 'not null' => TRUE, |
| 323 'default' => '', | 323 'default' => '', |
| 324 'description' => t('Drupal path in case of online discovered translations or file path in case of imported strings.'), | 324 'description' => 'Drupal path in case of online discovered translations or file path in case of imported strings.', |
| 325 ), | 325 ), |
| 326 'textgroup' => array( | 326 'textgroup' => array( |
| 327 'type' => 'varchar', | 327 'type' => 'varchar', |
| 328 'length' => 255, | 328 'length' => 255, |
| 329 'not null' => TRUE, | 329 'not null' => TRUE, |
| 330 'default' => 'default', | 330 'default' => 'default', |
| 331 'description' => t('A module defined group of translations, see hook_locale().'), | 331 'description' => 'A module defined group of translations, see hook_locale().', |
| 332 ), | 332 ), |
| 333 'source' => array( | 333 'source' => array( |
| 334 'type' => 'text', | 334 'type' => 'text', |
| 335 'mysql_type' => 'blob', | 335 'mysql_type' => 'blob', |
| 336 'not null' => TRUE, | 336 'not null' => TRUE, |
| 337 'description' => t('The original string in English.'), | 337 'description' => 'The original string in English.', |
| 338 ), | 338 ), |
| 339 'version' => array( | 339 'version' => array( |
| 340 'type' => 'varchar', | 340 'type' => 'varchar', |
| 341 'length' => 20, | 341 'length' => 20, |
| 342 'not null' => TRUE, | 342 'not null' => TRUE, |
| 343 'default' => 'none', | 343 'default' => 'none', |
| 344 'description' => t('Version of Drupal, where the string was last used (for locales optimization).'), | 344 'description' => 'Version of Drupal, where the string was last used (for locales optimization).', |
| 345 ), | 345 ), |
| 346 ), | 346 ), |
| 347 'primary key' => array('lid'), | 347 'primary key' => array('lid'), |
| 348 'indexes' => array( | 348 'indexes' => array( |
| 349 'source' => array(array('source', 30)), | 349 'source' => array(array('source', 30)), |
| 350 ), | 350 ), |
| 351 ); | 351 ); |
| 352 | 352 |
| 353 $schema['locales_target'] = array( | 353 $schema['locales_target'] = array( |
| 354 'description' => t('Stores translated versions of strings.'), | 354 'description' => 'Stores translated versions of strings.', |
| 355 'fields' => array( | 355 'fields' => array( |
| 356 'lid' => array( | 356 'lid' => array( |
| 357 'type' => 'int', | 357 'type' => 'int', |
| 358 'not null' => TRUE, | 358 'not null' => TRUE, |
| 359 'default' => 0, | 359 'default' => 0, |
| 360 'description' => t('Source string ID. References {locales_source}.lid.'), | 360 'description' => 'Source string ID. References {locales_source}.lid.', |
| 361 ), | 361 ), |
| 362 'translation' => array( | 362 'translation' => array( |
| 363 'type' => 'text', | 363 'type' => 'text', |
| 364 'mysql_type' => 'blob', | 364 'mysql_type' => 'blob', |
| 365 'not null' => TRUE, | 365 'not null' => TRUE, |
| 366 'description' => t('Translation string value in this language.'), | 366 'description' => 'Translation string value in this language.', |
| 367 ), | 367 ), |
| 368 'language' => array( | 368 'language' => array( |
| 369 'type' => 'varchar', | 369 'type' => 'varchar', |
| 370 'length' => 12, | 370 'length' => 12, |
| 371 'not null' => TRUE, | 371 'not null' => TRUE, |
| 372 'default' => '', | 372 'default' => '', |
| 373 'description' => t('Language code. References {languages}.language.'), | 373 'description' => 'Language code. References {languages}.language.', |
| 374 ), | 374 ), |
| 375 'plid' => array( | 375 'plid' => array( |
| 376 'type' => 'int', | 376 'type' => 'int', |
| 377 'not null' => TRUE, // This should be NULL for no referenced string, not zero. | 377 'not null' => TRUE, // This should be NULL for no referenced string, not zero. |
| 378 'default' => 0, | 378 'default' => 0, |
| 379 'description' => t('Parent lid (lid of the previous string in the plural chain) in case of plural strings. References {locales_source}.lid.'), | 379 'description' => 'Parent lid (lid of the previous string in the plural chain) in case of plural strings. References {locales_source}.lid.', |
| 380 ), | 380 ), |
| 381 'plural' => array( | 381 'plural' => array( |
| 382 'type' => 'int', | 382 'type' => 'int', |
| 383 'not null' => TRUE, | 383 'not null' => TRUE, |
| 384 'default' => 0, | 384 'default' => 0, |
| 385 'description' => t('Plural index number in case of plural strings.'), | 385 'description' => 'Plural index number in case of plural strings.', |
| 386 ), | 386 ), |
| 387 ), | 387 ), |
| 388 'primary key' => array('language', 'lid', 'plural'), | 388 'primary key' => array('language', 'lid', 'plural'), |
| 389 'indexes' => array( | 389 'indexes' => array( |
| 390 'lid' => array('lid'), | 390 'lid' => array('lid'), |
