1

I work with:

OS X El Capitan 10.11.5

XCode 8.2.1

Swift 3.0

I have two Localizable.strings files (English and Spanish) in my project that work perfect. This files are in their respective folders:

  • en.lproj
  • es.lproj

For some reason git doesn't recognize these two Localizable.strings files when I commit changes in my project.

I made a test changing the extension from *.strings to *.txt and it was recognized instantly by git as a change available to be commited.

I tried some "solutions" I found but they don't work at all:

  1. Added a file named .gitattributes with the following text in it: *.strings diff=localizablestrings
  2. In the file config in the folder .git I added the following code:

[diff "localizablestrings"] textconv = "iconv -f utf-16 -t utf-8"

Nothing made git recognize my Localizable.strings. May you please help me find what am I missing? Thank you.

rmaddy
  • 314,917
  • 42
  • 532
  • 579
oscar
  • 189
  • 1
  • 2
  • 11

2 Answers2

0

I finally found how to fix this:

First I forced through terminal this way:

git add -f folderWhereTheFilesAre/Localizable.strings

This forced git to recognize these files.

I was going to commit this but thougth it's better to do it without forcing it so I added a .gitignore file with the following in it:

!/FolderName/en.lproj/*
!/FolderName/es.lproj/*

Then I commited (and pushed) only this .gitignore file and then both Terminal and SourceTree finally detected these two files without forcing it. Then I could commit and push the Localizable.strings.

oscar
  • 189
  • 1
  • 2
  • 11
0

Add a new line *.strings binary=false to file <repo_root>/.git/info/attributes. (If there is no such file in your repo, create one.)

wzso
  • 3,482
  • 5
  • 27
  • 48