potsky / laravel-localization-helpers

🎌 Artisan commands to generate and update lang files automatically
GNU General Public License v3.0
187 stars 39 forks source link

VCS friendly updates #39

Closed adriandmitroca closed 8 years ago

adriandmitroca commented 8 years ago

Hey @potsky,

It would be nice to update translations without changing content of basically whole translation's file. In this situation, when you create new translation string you don't commit change with bunch of changed lines but just with one insert.

potsky commented 8 years ago

Hi,

the whole file is regenerated but the same method as on previous run so it is not changed. Here is a example of a modification:

screenshot 2016-09-29 10 47 33

How can you get a whole changed file with a new line for example?

adriandmitroca commented 8 years ago

I was thinking only about new translations. Let me give you a quick example for that:

Instead of that:

<?php

return  [
  //============================== New strings to translate ==============================//
  'h1' => 'JOIN ZOPTOMA - ABSOLUTELY FREE!',
  //==================================== Translations ====================================//
  'register_button' => 'Sign up',
];

I would like to get this:

  //==================================== Translations ====================================//
  'h1' => 'JOIN ZOPTOMA - ABSOLUTELY FREE!',
  'register_button' => 'Sign up',
];

That would avoid a lot of git conflicts while few people in the team works on similar translations at the same time.

potsky commented 8 years ago

You should remove comments from the lang files, shouldn't you?

By using the -c or the --no-comment option.

adriandmitroca commented 8 years ago

Would that remove separation between new and old translations?

potsky commented 8 years ago

Necessarily because you want h1 to be with register_button lemma or there is something, which I did not catch :-(

You will be able to check new strings to translate by searching for TODO or your custom marker.