Skip to content

Commit

Permalink
GRN2-112: Default language fallback fails with a 500 error (#469)
Browse files Browse the repository at this point in the history
* GRN2-112: Default language fallback fails with a 500 error

* Updates for passing rspec tests

* Added cache for gitlab ci

* Updated cache for gitlab

* Restored Dockerfile

* Fixed glitch in filter for build and deployment
  • Loading branch information
jfederico authored Apr 17, 2019
1 parent c8a799b commit 9b2424c
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 6 deletions.
4 changes: 4 additions & 0 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@ stages:
- build
- deploy

cache:
paths:
- /cache

before_script:

test:
Expand Down
5 changes: 3 additions & 2 deletions app/controllers/application_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -44,11 +44,12 @@ def set_locale
end

def update_locale(user)
I18n.locale = if user && user.language != 'default'
user.language.tr('-', '_')
locale = if user && user.language != 'default'
user.language
else
http_accept_language.language_region_compatible_from(I18n.available_locales)
end
I18n.locale = locale.tr('-', '_') unless locale.nil?
end

def meeting_name_limit
Expand Down
2 changes: 1 addition & 1 deletion config/locales/es.yml
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ es:
go_back: Atrás
greenlight: Greenlight
header:
create_room: Creat sala
create_room: Crear sala
dropdown:
help: "¿Necesitas ayuda?"
home: Sala principal
Expand Down
2 changes: 1 addition & 1 deletion config/locales/es_MX.yml
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ es_MX:
go_back: Atrás
greenlight: Greenlight
header:
create_room: Creat sala
create_room: Crear sala
dropdown:
help: "¿Necesitas ayuda?"
home: Sala principal
Expand Down
2 changes: 1 addition & 1 deletion scripts/image_build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ if [ -z $CD_DOCKER_REPO ]; then
export CD_DOCKER_REPO=$CD_REF_SLUG
fi

if [ "$CD_REF_NAME" != "master" ] && [[ "$CD_REF_NAME" != *"release"* ]] && [ -z $CD_BUILD_ALL ];then
if [ "$CD_REF_NAME" != "master" ] && [[ "$CD_REF_NAME" != *"release"* ]] && ( -z $CD_BUILD_ALL ] || [ "$CD_BUILD_ALL" != "true" ] ); then
echo "#### Docker image for $CD_REF_SLUG won't be built"
exit 0
fi
Expand Down
2 changes: 1 addition & 1 deletion scripts/image_deploy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ if [ -z $CD_DOCKER_REPO ]; then
export CD_DOCKER_REPO=$CD_REF_SLUG
fi

if [ "$CD_REF_NAME" != "master" ] && [[ "$CD_REF_NAME" != *"release"* ]] && [ -z $CD_DEPLOY_ALL ];then
if [ "$CD_REF_NAME" != "master" ] && [[ "$CD_REF_NAME" != *"release"* ]] && ( [ -z $CD_DEPLOY_ALL ] || [ "$CD_DEPLOY_ALL" != "true" ] ); then
echo "#### Docker image for $CD_DOCKER_REPO won't be deployed. The conditions for running this build were not met."
exit 0
fi
Expand Down

0 comments on commit 9b2424c

Please sign in to comment.