{"id":10664,"date":"2011-11-09T08:00:38","date_gmt":"2011-11-09T14:00:38","guid":{"rendered":"http:\/\/quechilero.com\/blog\/?p=10664"},"modified":"2011-11-09T08:00:38","modified_gmt":"2011-11-09T14:00:38","slug":"ubuntu-server-cambiando-el-idioma","status":"publish","type":"post","link":"https:\/\/quechilero.com\/blog\/2011\/11\/09\/ubuntu-server-cambiando-el-idioma\/","title":{"rendered":"Ubuntu Server: Cambiando el idioma"},"content":{"rendered":"<p>Hace \u00a0un tiempo instal\u00e9 un nuevo servidor, utilizando <em>Ubuntu Server<\/em>\u00a0como sistema operativo. En el momento de la instalaci\u00f3n, \u00e9sta se hizo en <em>ingl\u00e9s<\/em>\u00a0y todo el sistema operativo qued\u00f3 configurado de esta forma.<\/p>\n<p>Posteriormente, se hizo necesario que estuviera en <em>espa\u00f1ol<\/em>, para poder utilizar correctamente la funci\u00f3n <em>setlocale<\/em>\u00a0en nuestro idioma, ya que aunque la defini\u00e9ramos as\u00ed\u00a0<em>setlocale(LC_TIME,\u00bbes_ES\u00bb);<\/em>\u00a0o en cualquiera de sus otras variantes, el resultado siempre quedaba en ingl\u00e9s.<\/p>\n<p>Esto se debe principalmente a que las librer\u00edas y archivos de configuraci\u00f3n del servidor, se encuentran, desde un inicio en ingl\u00e9s y no se instalaron las correspondientes en espa\u00f1ol.<\/p>\n<p>Sin embargo, la soluci\u00f3n es muy <em>r\u00e1pida y sencilla<\/em>. Para esto, <a title=\"Ubuntu Server: Cambiando el idioma\" href=\"http:\/\/www.e-octante.com\/2011\/04\/23\/cambiar-idioma-ubuntu-server\/\" target=\"_blank\">seguimos cuatro pasos<\/a>:<\/p>\n<ol>\n<li>Editamos el fichero\u00a0<em>\/var\/lib\/locales\/supported.d\/local<\/em>\u00a0y cambiamos el <em>locale<\/em>\u00a0por el que necesitamos.<\/li>\n<li>Volvemos a generar los <em>locale<\/em>\u00a0con\u00a0<em>sudo dpkg-reconfigure locales<\/em><\/li>\n<li>Editamos el fichero\u00a0<em><em>\/etc\/environment<\/em><\/em>\u00a0y luego el fichero<em>\/etc\/default\/locale<\/em><\/li>\n<li>Reiniciamos el servidor <em>sudo reboot<\/em><\/li>\n<\/ol>\n<p>Con esto, ya tenemos la instalaci\u00f3n de nuestro servidor, con el idioma que necesitamos y ya no tendremos problema al definir el <em>setlocale<\/em> en nuestros archivos php.<\/p>\n<p>En mi caso particular, el servidor lo configur\u00e9 a <em>Espa\u00f1ol-Guatemala<\/em>, y los archivos quedaron as\u00ed:<\/p>\n<ul>\n<li>El fichero: <em>\/var\/lib\/locales\/supported.d\/local<\/em> con\u00a0es_GT.UTF-8 UTF-8 (hay un espacio entre los UTF-8)<\/li>\n<li>El fichero: <em>\/etc\/environment<\/em> con LANGUAGE=\u00bbes_GT\u00bb LANG=\u00bbes_GT.utf8&#8243; (Language y Lang en l\u00edneas diferentes)<\/li>\n<li>El fichero: <em>\/etc\/default\/locale<\/em> con LANG=\u00bbes_GT.utf8&#8243; LANGUAGE=\u00bbes_GT\u00bb (Lang y Language en l\u00edneas diferentes)<\/li>\n<\/ul>\n<p>Gracias a <a title=\"Ubuntu Server: Cambiando el idioma\" href=\"http:\/\/www.e-octante.com\/2011\/04\/23\/cambiar-idioma-ubuntu-server\/\" target=\"_blank\">E-Octante<\/a> por la gu\u00eda<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Hace \u00a0un tiempo instal\u00e9 un nuevo servidor, utilizando Ubuntu Server\u00a0como sistema operativo. En el momento de la instalaci\u00f3n, \u00e9sta se hizo en ingl\u00e9s\u00a0y todo el sistema operativo qued\u00f3 configurado de esta forma. Posteriormente, se hizo necesario que estuviera en espa\u00f1ol, para poder utilizar correctamente la funci\u00f3n setlocale\u00a0en nuestro idioma, ya que aunque la defini\u00e9ramos as\u00ed\u00a0setlocale(LC_TIME,\u00bbes_ES\u00bb);\u00a0o &#8230; <a title=\"Ubuntu Server: Cambiando el idioma\" class=\"read-more\" href=\"https:\/\/quechilero.com\/blog\/2011\/11\/09\/ubuntu-server-cambiando-el-idioma\/\" aria-label=\"Leer m\u00e1s sobre Ubuntu Server: Cambiando el idioma\">Leer m\u00e1s<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"advanced_seo_description":"","jetpack_seo_html_title":"","jetpack_seo_noindex":false,"episode_type":"","audio_file":"","cover_image":"","cover_image_id":"","duration":"","filesize":"","date_recorded":"","explicit":"","block":"","filesize_raw":"","jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":false,"jetpack_social_options":{"image_generator_settings":{"template":"highway","enabled":false},"version":2}},"categories":[2],"tags":[10,21,34,5],"series":[],"class_list":["post-10664","post","type-post","status-publish","format-standard","hentry","category-limones","tag-guatemala","tag-problema","tag-solucion","tag-tiempo"],"episode_featured_image":false,"episode_player_image":"https:\/\/i0.wp.com\/quechilero.com\/blog\/imagenes\/podcast.png?fit=1831%2C1831&ssl=1","download_link":"","player_link":"","audio_player":false,"episode_data":{"playerMode":"dark","subscribeUrls":{"amazon":{"key":"amazon","url":"","label":"Amazon","class":"amazon","icon":"amazon.png"},"apple_podcasts":{"key":"apple_podcasts","url":"","label":"Apple Podcasts","class":"apple_podcasts","icon":"apple-podcasts.png"},"castbox":{"key":"castbox","url":"","label":"CastBox","class":"castbox","icon":"castbox.png"},"deezer":{"key":"deezer","url":"","label":"Deezer","class":"deezer","icon":"deezer.png"},"google_podcasts":{"key":"google_podcasts","url":"","label":"Google Podcasts","class":"google_podcasts","icon":"google-podcasts.png"},"listen_notes":{"key":"listen_notes","url":"","label":"Listen Notes","class":"listen_notes","icon":"listen-notes.png"},"pandora":{"key":"pandora","url":"","label":"Pandora","class":"pandora","icon":"pandora.png"},"podbean":{"key":"podbean","url":"","label":"Podbean","class":"podbean","icon":"podbean.png"},"podcast_republic":{"key":"podcast_republic","url":"","label":"Podcast Republic","class":"podcast_republic","icon":"podcast-republic.png"},"rss":{"key":"rss","url":"","label":"RSS","class":"rss","icon":"rss.png"},"spotify":{"key":"spotify","url":"","label":"Spotify","class":"spotify","icon":"spotify.png"},"stitcher":{"key":"stitcher","url":"","label":"Stitcher","class":"stitcher","icon":"stitcher.png"},"tunein":{"key":"tunein","url":"","label":"TuneIn","class":"tunein","icon":"tunein.png"},"youtube":{"key":"youtube","url":"","label":"YouTube","class":"youtube","icon":"youtube.png"},"iheartradio":{"key":"iheartradio","url":"","label":"iHeartRadio","class":"iheartradio","icon":"iheartradio.png"},"ivoox":{"key":"ivoox","url":"","label":"iVoox","class":"ivoox","icon":"ivoox.png"}},"rssFeedUrl":"https:\/\/quechilero.com\/blog\/feed\/podcast\/si-la-vida-nos-da-limones","embedCode":"<blockquote class=\"wp-embedded-content\" data-secret=\"uEwEoQaLnk\"><a href=\"https:\/\/quechilero.com\/blog\/2011\/11\/09\/ubuntu-server-cambiando-el-idioma\/\">Ubuntu Server: Cambiando el idioma<\/a><\/blockquote><iframe sandbox=\"allow-scripts\" security=\"restricted\" src=\"https:\/\/quechilero.com\/blog\/2011\/11\/09\/ubuntu-server-cambiando-el-idioma\/embed\/#?secret=uEwEoQaLnk\" width=\"500\" height=\"350\" title=\"\u00abUbuntu Server: Cambiando el idioma\u00bb \u2014 Si la Vida nos da Limones...\" data-secret=\"uEwEoQaLnk\" frameborder=\"0\" marginwidth=\"0\" marginheight=\"0\" scrolling=\"no\" class=\"wp-embedded-content\"><\/iframe><script>\n\/*! This file is auto-generated *\/\n!function(d,l){\"use strict\";l.querySelector&&d.addEventListener&&\"undefined\"!=typeof URL&&(d.wp=d.wp||{},d.wp.receiveEmbedMessage||(d.wp.receiveEmbedMessage=function(e){var t=e.data;if((t||t.secret||t.message||t.value)&&!\/[^a-zA-Z0-9]\/.test(t.secret)){for(var s,r,n,a=l.querySelectorAll('iframe[data-secret=\"'+t.secret+'\"]'),o=l.querySelectorAll('blockquote[data-secret=\"'+t.secret+'\"]'),c=new RegExp(\"^https?:$\",\"i\"),i=0;i<o.length;i++)o[i].style.display=\"none\";for(i=0;i<a.length;i++)s=a[i],e.source===s.contentWindow&&(s.removeAttribute(\"style\"),\"height\"===t.message?(1e3<(r=parseInt(t.value,10))?r=1e3:~~r<200&&(r=200),s.height=r):\"link\"===t.message&&(r=new URL(s.getAttribute(\"src\")),n=new URL(t.value),c.test(n.protocol))&&n.host===r.host&&l.activeElement===s&&(d.top.location.href=t.value))}},d.addEventListener(\"message\",d.wp.receiveEmbedMessage,!1),l.addEventListener(\"DOMContentLoaded\",function(){for(var e,t,s=l.querySelectorAll(\"iframe.wp-embedded-content\"),r=0;r<s.length;r++)(t=(e=s[r]).getAttribute(\"data-secret\"))||(t=Math.random().toString(36).substring(2,12),e.src+=\"#?secret=\"+t,e.setAttribute(\"data-secret\",t)),e.contentWindow.postMessage({message:\"ready\",secret:t},\"*\")},!1)))}(window,document);\n\/\/# sourceURL=https:\/\/quechilero.com\/blog\/wp-includes\/js\/wp-embed.min.js\n<\/script>\n"},"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_shortlink":"https:\/\/wp.me\/pDKli-2M0","jetpack_sharing_enabled":true,"jetpack-related-posts":[],"_links":{"self":[{"href":"https:\/\/quechilero.com\/blog\/wp-json\/wp\/v2\/posts\/10664","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/quechilero.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/quechilero.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/quechilero.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/quechilero.com\/blog\/wp-json\/wp\/v2\/comments?post=10664"}],"version-history":[{"count":0,"href":"https:\/\/quechilero.com\/blog\/wp-json\/wp\/v2\/posts\/10664\/revisions"}],"wp:attachment":[{"href":"https:\/\/quechilero.com\/blog\/wp-json\/wp\/v2\/media?parent=10664"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/quechilero.com\/blog\/wp-json\/wp\/v2\/categories?post=10664"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/quechilero.com\/blog\/wp-json\/wp\/v2\/tags?post=10664"},{"taxonomy":"series","embeddable":true,"href":"https:\/\/quechilero.com\/blog\/wp-json\/wp\/v2\/series?post=10664"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}