Extension:LanguageSelector/pt

English  • 日本語 • português


Manual de extensões do MediaWiki
OOjs UI icon advanced.svg
Seletor de Idioma
Estado de lançamento: beta
Implementação Minha Wiki , etiqueta (invalid type), Idioma
Descrição Fornece um seletor de idioma em cada página, também para os visitantes; deteção automática do idioma do visitante
Autor(es) Daniel Kinzler (Duesentriebtalk)
MediaWiki 1.19+
Alterações à base de dados Não
Licença GPL
Transferência
README
Exemplo translatewiki.net
  • $wgLanguageSelectorDetectLanguage
  • $wgLanguageSelectorLanguages
  • $wgLanguageSelectorLocation
Traduza a extensão LanguageSelector se ela estiver disponível em translatewiki.net
Verifique a utilização e a matriz de versões
Problemas Tarefas em aberto · Reportar um erro

A extensão LanguageSelector fornece deteção do idioma da interface para utilizar para os visitantes anónimos, e um menu para selecionar o idioma do utilizador em cada página, para os utilizadores autenticados, bem como para os visitantes anónimos. Esta também fornece uma etiqueta adicional, <languageselector>, para integrar o seletor nas páginas wiki e nas mensagens do sistema.

Language detection is based on the Accept-Language header sent by the browser as part of the HTTP request. Users can also set their preferred language explicitly - this is handled by a separate cookie for anonymous visitors, and in the user preferences for logged in users.

Para suporte mais completo para o conteúdo multilingue, "LanguageSelector" pode combinar com as extensões Multilingue e Poliglota.

Nota Nota: language detection and cookie-based language preferences for anonymous users currently does not work with page caching (MediaWiki filecache, reverse HTTP proxies like squid, etc). It may degrade cache performance and render the cache useless, and it may lead to people seeing the page in a random language. Mediawiki's internal caches (parser, link, query, etc) are not affected.

InstalaçãoEdit

  • Exporte e coloque o ficheiro, ou ficheiros, num diretório chamado LanguageSelector, na sua pasta extensions/.
  • Acrescente o seguinte código ao fundo do ficheiro LocalSettings.php:
    require_once "$IP/extensions/LanguageSelector/LanguageSelector.php";
    
  •   Pronto – Na página especial Special:Version da sua wiki verifique se a extensão foi instalada.

ConfiguraçãoEdit

You can specify the following settings in your LocalSettings.php (after including the extension file):

$wgLanguageSelectorLanguages
Languages to be offered to the user for selection. If set to NULL (the default), all languages known to MediaWiki (by $wgExtraLanguageNames) are considered. If the Polyglot extension is installed and $wgPolyglotLanguages is set, that value will be used as a fallback. Setting $wgLanguageSelectorLanguages to a shorter list may be more convenient for users than selecting from a list with more than a hundred mostly useless entries. This variable must be an array, so you can declare it like this:
$wgLanguageSelectorLanguages = array( "en", "es", "pt" );

Os códigos "en", "es" e "pt" stand significam inglês, espanhol e português, respetivamente.

$wgLanguageSelectorShowCode (since rev:55711)
whether to show language codes before the native language name. Default is false;
$wgLanguageSelectorDetectLanguage
Language detection mode for anonymous visitors. Possible values:
  • LANGUAGE_SELECTOR_USE_CONTENT_LANG: do not use detection, always use the wiki's content language (this is mediawiki's normal behavior).
  • LANGUAGE_SELECTOR_PREFER_CONTENT_LANG: use the wiki's content language, setting, if accepted by the client.
  • LANGUAGE_SELECTOR_PREFER_CLIENT_LANG: use the client's preferred language, if it is in $wgLanguageSelectorLanguages.
$wgLanguageSelectorLocation
where to inject the language selector widget. Note that you will probably have to adjust your CSS styles to adopt the language selector to your wiki's style. Possible values of $wgLanguageSelectorLocation:
  • LANGUAGE_SELECTOR_MANUAL: do not show language selector. This can be usefull if you only want to use the auto-detection feature, or only want the selector on a few pages, or if you want to place it manually by putting it into an appropriate system message.
  • LANGUAGE_SELECTOR_AT_TOP_OF_TEXT: inject a dropdown box at the top of page content. This is the default, but it looks quite ugly without extra CSS rules applied.
  • LANGUAGE_SELECTOR_IN_TOOLBOX: inject a dropdown box at the bottom of the toolbox in the sidebar. This only works with the MonoBook skin, or skins explicitly supporting the MonoBookTemplateToolboxEnd hook.
  • LANGUAGE_SELECTOR_AS_PORTLET: inject the language selector as a portlet in the sidebar, similar to how interlanguage-links are shown. Works with MonoBook skin, may also work with some SkinTemplate-based skins.
  • LANGUAGE_SELECTOR_INTO_SITENOTICE: inject a dropdown box at the end of the sitenotice text. Ugly without additional CSS rules applied. Works with MonoBook skin, may also work with some SkinTemplate-based skins.
  • LANGUAGE_SELECTOR_INTO_TITLE: inject a dropdown box at the end of the page title. Ugly without additional CSS rules applied. Works with MonoBook skin, may also work with some SkinTemplate-based skins.
  • LANGUAGE_SELECTOR_INTO_SUBTITLE: inject a dropdown box at the end of the subtitle. Ugly without additional CSS rules applied. Works with MonoBook skin, may also work with some SkinTemplate-based skins.
  • LANGUAGE_SELECTOR_INTO_CATLINKS: inject a dropdown box at the end of the category box. Ugly without additional CSS rules applied. Works with MonoBook skin, may also work with some SkinTemplate-based skins.

Exemplo:

$wgLanguageSelectorDetectLanguage = LANGUAGE_SELECTOR_USE_CONTENT_LANG;
$wgLanguageSelectorLocation = LANGUAGE_SELECTOR_IN_TOOLBOX;

Consulte tambémEdit