internationalization - Cakephp delete translation for specific language -


I have tried to make some translation behavior on a model. But how do I delete a specific translation?

My example is a class in which its name should be translated, which should be translated. Let me have a translation in English and Spanish How can I delete the Spanish translation? Offcouse I can create my own SQL query but there is a way to do this in the cakepp.

there is no cake function to do this

However, receiving This is quite easy for

Delete all translations for a given location

Any destructive action to remove all translations for a given locale - by doing anything First DB backup can first fix a mistake or remove something unexpected):

  Delete from i18n WHERE locale = 'AS Minister ';   

Of course, the locale depends on your specific application - you can check your configuration, or just ask DB:

  SELECT DISTINCT (Locale) FROM i18n;   

Delete all translations for a given locale and model

Just add a model status:

  Delete from i18n WHERE Locale = Esp 'and Model =' Category ';   

Delete all translations for specific model fields

You will need to know the ID of the record that you want to operate, then:

 Remove from  i18n WHERE locale = 'esp' and model = 'range' and foreign_kar = 2468789 and field = 'name';   

If you ask questions directly on DB do not believe, first to see what you want to delete:

  SELECT * WHERE locale = 'ASP' from I18n and model = 'category' and foreign_key = 2468789 and field = 'name';   

I.e. Find what you want, and then just change the SELECT to a DELETE statement.

Comments

Popular posts from this blog

excel vba - How to delete Solver(SOLVER.XLAM) code -

github - Teamcity & Git - PR merge builds - anyway to get HEAD commit hash? -

ios - Replace text in UITextView run slowly -