This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var tName; | |
// center | |
public var center : Vector2; | |
var centerX : float; | |
var centerY : float; | |
var height : float; | |
var halfHeight : float; | |
var width : float; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#Selector de idioma | |
#dependencias: | |
# 1 - Rack locale del paquete Rack-contrib [1] | |
# USO: Se usa para detectar el idioma definido por el usuario en su browser ['HTTP_ACCEPT_LANGUAGE'] | |
# Esplicado aquí http://guides.rubyonrails.org/i18n.html#using-accept-language | |
# [1] http://github.com/rack/rack-contrib | |
# 2 - Routing-filter [1] | |
# USO: Establecer el locale en las URLs ej.: www.mysite.com/es/foo/bar | |
# NOTA: Si tambien quieres traducir las URL's usa la gema de Raul Murciano Translate_routes [2] (De momento sin cobertura para Rails3) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# application_controller.rb | |
before_filter :set_locale | |
private | |
def set_locale | |
new_locale = params[:locale] || cookies[:locale] || extract_locale_from_accept_language_header || I18n.default_locale | |
if I18n.available_locales.include?( new_locale.to_sym ) | |
I18n.locale = new_locale |