Answers.Body: <p>Why not just check your site into a git or subversion repository, and when the translation files are updated, push them to the repo, and have the other servers pull the changes down?</p>
  
  <p>You could even automate it with the various git hooks.</p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-09-28T03:20:26.093Z
Answers.Text: Thanks @khalwat, yeah something like that could work for sure. I think the complication in all of this is using the "translate" plugin... I think we are going to have to stop using it and just do something like this instead.
Answers.UserDisplayName: markstewie
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-09-27T23:00:23.860Z
Answers.LastActivityDate: 2015-09-27T23:00:23.860Z
Answers.UserDisplayName: andrew.welch
Answers.Body: <p>Another solution would be to setup a cronjob on your master server to run a rsync on the translation files to the other edge servers every minute / 10 minute.</p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-09-28T07:45:51.493Z
Answers.LastActivityDate: 2015-09-28T07:45:51.493Z
Answers.UserDisplayName: naboovalley
Answers.Body: <p>One option would be to set the <a href="http://buildwithcraft.com/docs/php-constants#craft-translations-path" rel="nofollow">CRAFT_TRANSLATIONS_PATH</a> PHP constant in your public <code>index.php</code> file and have that point to a network storage path that all web servers can point to.</p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-09-27T19:45:52.553Z
Answers.Text: Thanks Brad, yeah thought that could be an option... but it makes it complicated that we're using the translate plugin as that has it's own translations path that stores the translation files inside the plugin folder by default.
Answers.UserDisplayName: markstewie
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-09-27T19:49:09.423Z
Answers.Text: Looks like someone ran into a similar issue already: https://github.com/boboldehampsink/translate/issues/12
Answers.UserDisplayName: Brad Bell
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-09-27T19:52:37.037Z
Answers.Text: Hmm.. yeah, that is exactly the same issue. Doesn't look like there is an easy solution.
Answers.UserDisplayName: markstewie
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-09-27T22:33:29.207Z
Answers.Text: Ok so if I don't use the translations plugin at all and set the CRAFT_TRANSLATIONS_PATH constant to a s3 translations bucket it works... (after setting allow_url_include to On in my php.ini) but makes every request slow. I'm really not sure what the answer is to this...
Answers.UserDisplayName: markstewie
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-09-28T05:34:43.213Z
Answers.Text: Yeah, that means you're making an S3 request on every Craft request. An NFS network share would be faster.
Answers.UserDisplayName: Brad Bell
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-09-27T19:43:16.387Z
Answers.LastActivityDate: 2015-09-27T19:43:16.387Z
Answers.UserDisplayName: Brad Bell
Body: <p>We have quite a large Craft based site that requires load balancing so there are often multiple instances of the site. </p>
  
  <p>The problem we are having is with the translation files. Because these are stored as files when you update them through the admin they are only updated on the site instance you are currently on. Obviously this isn't scalable. </p>
  
  <p>What would be the best solution to make these static translations scalable in this sort of environment? Move the translation files to an S3 bucket? (this would be ideal but have don't think this is possible) or move all translation fields to the database somehow? (what would be the best field type to store them as and where?) or is there some other solution?</p>
  
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2015-09-27T19:37:44.653Z
Comments.Text: Are you referring to Craft's [static translation](http://buildwithcraft.com/help/static-translations) support? I think so, but you mention updating them through the admin and now I'm not sure.
Comments.UserDisplayName: Brad Bell
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2015-09-27T19:41:13.560Z
Comments.Text: Yes I am referring to the static translation support... and sorry forgot to mention that we're using the "translate" plugin that gives an interface for updating these files through the admin https://straightupcraft.com/craft-plugins/translate.
Comments.UserDisplayName: markstewie
Tags: <localization>
Title: Translation files on load balanced multiple instance site
ThreadText: # Translation files on load balanced multiple instance site
  
  (Asked by: username_0 on 2015-09-27)
  
  We have quite a large Craft based site that requires load balancing so there are often multiple instances of the site.
  
  The problem we are having is with the translation files. Because these are stored as files when you update them through the admin they are only updated on the site instance you are currently on. Obviously this isn't scalable.
  
  What would be the best solution to make these static translations scalable in this sort of environment? Move the translation files to an S3 bucket? (this would be ideal but have don't think this is possible) or move all translation fields to the database somehow? (what would be the best field type to store them as and where?) or is there some other solution?
  
  **Tags:** localization
  
  > **Comments:**
  > **username_1**: Are you referring to Craft's [static translation](http://buildwithcraft.com/help/static-translations) support? I think so, but you mention updating them through the admin and now I'm not sure.  
  > **username_0**: Yes I am referring to the static translation support... and sorry forgot to mention that we're using the "translate" plugin that gives an interface for updating these files through the admin https://straightupcraft.com/craft-plugins/translate.  
  
  ---
  
  ## 3 answers
  
  ### Answer by username_2 on 2015-09-27. Score: 1
  
  Why not just check your site into a git or subversion repository, and when the translation files are updated, push them to the repo, and have the other servers pull the changes down?
  
  You could even automate it with the various git hooks.
  
  > **Comments:**
  > **username_0**: Thanks @khalwat, yeah something like that could work for sure. I think the complication in all of this is using the "translate" plugin... I think we are going to have to stop using it and just do something like this instead.  
  
  ---
  
  ### Answer by username_3 on 2015-09-28. Score: 0
  
  Another solution would be to setup a cronjob on your master server to run a rsync on the translation files to the other edge servers every minute / 10 minute.
  
  
  ---
  
  ### Answer by username_1 on 2015-09-27. Score: 0
  
  One option would be to set the [CRAFT\_TRANSLATIONS\_PATH](http://buildwithcraft.com/docs/php-constants#craft-translations-path) PHP constant in your public `index.php` file and have that point to a network storage path that all web servers can point to.
  
  > **Comments:**
  > **username_0**: Thanks username_1, yeah thought that could be an option... but it makes it complicated that we're using the translate plugin as that has it's own translations path that stores the translation files inside the plugin folder by default.  
  > **username_1**: Looks like someone ran into a similar issue already: https://github.com/boboldehampsink/translate/issues/12  
  > **username_0**: Hmm.. yeah, that is exactly the same issue. Doesn't look like there is an easy solution.  
  > **username_0**: Ok so if I don't use the translations plugin at all and set the CRAFT_TRANSLATIONS_PATH constant to a s3 translations bucket it works... (after setting allow_url_include to On in my php.ini) but makes every request slow. I'm really not sure what the answer is to this...  
  > **username_1**: Yeah, that means you're making an S3 request on every Craft request. An NFS network share would be faster.  
  
  ---
  
  